Get Week Number in SQL Server

It happens frequently that certain clients want to see the weeknumber of certain dates in CRM reports.
To accomplish this, you can use the following function in your query to get the week number for a given date:

select datepart(ww,scheduledstart) from filteredappointment

The above query will give you the weeknumber of the scheduled start date from the filtered appointments view.


Kevin Dosseray

Comments

Popular posts from this blog

Scribe and Excel Data Ranges

Scribe MVP!