Quantcast
Channel: Solved » sql-server
Viewing all articles
Browse latest Browse all 48

Get Day of Week in SQL 2005/2008

$
0
0

Say 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 Sql2005/2008? Or do I need to use an auxiliary table?

Solution

use datename

select datename(dw,getdate()) --Friday

select datepart(dw,getdate()) --6

The post Get Day of Week in SQL 2005/2008 appeared first on Solved.


Viewing all articles
Browse latest Browse all 48

Trending Articles