• All marks go to Lutz 😉

    This does not work.

    Well i just checked it and it does work.

    The DAY built-in function returns just the day date part of the supplied date, so for 19th July 2010, it would return 19.

    Yes this would return 19

    Supplying the value 19 to the DATEPART function results in 19 being implicitly converted to a date (19 days after the base date '1900-01-01') to give '1900-01-20'. Knowing the week number of 20th January 1900 is unlikely to be the desired result

    Supplying the value value 19 to DATEPART function with the first option 'WEEK', it will return 3 which means this is the 3rd week of the month.

    One more thing to add the function DATEPART(WEEK,<ANY NUMBER FROM 0-364>) will return the current week number.

    For instance,

    select DATEPART(WEEK,21)

    will return 4 as 3 weeks have finished.

    Let me know please if this does not work and correct me if i am wrong at perceiving this.

    Thanks