Sunday, February 19, 2012

DATENAME - can you not get it to say the actual day name?

SELECT DATENAME(day, getdate()) AS 'Day Name'

comes back as 15 but i want it to come back with thursday

Cheers,
Craig

use dw

SELECT DATENAME(dw, getdate()) AS 'Day Name'

this stuff is clearly documented in BOL with in the section on datename

|||

what makes it worse is that i was sitting looking at datename page in BOL

jsut one of those days where you cant see the wood for the trees!!

soz,
Craig

|||at least you looked before you posted :)

No comments:

Post a Comment