Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in SQL by (20.3k points)

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?

1 Answer

0 votes
by (40.4k points)

You can use DATEPART or DATENAME like this:

SELECTDATEPART(dw,GETDATE()) – 6

SELECT DATENAME(dw,GETDATE()) – Friday

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 30, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...