![]() ![]() In this article, we'll show you how to get the first day of the week in SQL Server. After all, how do we know what "week 22" means? Is it in April, May, or June? It's better to display a date associated with each week, i.e. The query displays the week number as the label for the week. The result looks something like this: Week ORDER BY DATEPART(week, RegistrationDate) ![]() GROUP BY DATEPART(week, RegistrationDate) The query might look like this:ĭATEPART(week, RegistrationDate) AS Week, In the previous article, we talked about how you can use the SQL Server DATEPART() function with week or iso_week to group events by week.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |