Pages

Men

rh

7/17/2012

DATENAME function in SQL Server

DATENAME()
 
This is used to find out the date name from the datetime value.

Example
SELECT DATENAME(dw, getdate()) AS 'Today'

Output:
Today
Tuesday

Exmaple:
SELECT DATENAME(month, getdate()) AS 'Month'

Output:
Month
July

Back

No comments :

Post a Comment