why is sql 2005 treating Sunday as last day of week
Posted on 2008-10-22
In Microsoft Access this function will return 1.
To me this is correct because 10/5/08 is a sunday which by computer standards is the first day of the week.
I can run the following line of code in a stored procedure on an SQL Server2000 database and it returns 1.
Select DatePart(weekday, '10/5/08') as Test
Still correct. I run that same SP on my customer's SQL Server2005 database and it returns 7.
I modifed the SP so that it now reads:
Set Datefirst 1 Select DatePart(weekday, '10/5/08') as Test
It still returns 7.
Is there some setting for SQL 2005 that I'm missing? Is there a server setting creating this?