Back
If I have a date 01/01/2009, I want to find out what day it was e.g. Monday, Tuesday, etc...
Is there a built-in function for this in SQL 2005/2008? Or do I need to use an auxiliary table?
You can use DATEPART or DATENAME like this:
SELECTDATEPART(dw,GETDATE()) – 6SELECT DATENAME(dw,GETDATE()) – Friday
SELECTDATEPART(dw,GETDATE()) – 6
SELECT DATENAME(dw,GETDATE()) – Friday
31k questions
32.8k answers
501 comments
693 users