Viewing 3 posts - 1 through 3 (of 3 total)
Ok. You've won me over.
I just did A quick test on the efficiency of each method.
Using the script below, my method took 2:20 to 2:30 to execute. Yours...
February 23, 2010 at 2:23 am
The method I posted earlier works fine for pre-1900 dates and gives an answer where mon=1 and sun=7
Select ((DatePart(dw,'2009-12-17') + @@DateFirst -2)%7)+1
Others have posted various ways of deriving the name...
February 21, 2010 at 4:26 am
To get Monday=1 and Sunday=7 I've been using this for years...
Select ((DatePart(dw,'2009-12-17') + @@DateFirst -2)%7)+1
February 19, 2010 at 3:16 am
Viewing 3 posts - 1 through 3 (of 3 total)