Thursday, January 6, 2011

Date in day Words -SQL_ Server

SELECT
CASE DATEPART(dw,getdate())
WHEN 2 THEN ‘MON’
WHEN 3 THEN ‘TUE’
WHEN 4 THEN ‘WED’
WHEN 5 THEN ‘THU’
WHEN 6 THEN ‘FRI’
WHEN 7 THEN ‘SAT’
WHEN 1 THEN ‘SUN’
ELSE ‘ALL’
END

http://blog.sqlauthority.com/2007/06/08/sql-server-udf-function-to-display-current-week-date-and-day-weekly-calendar/

No comments: