Thursday, October 30, 2008

This is something I don't want to write again...


CASE WHEN DATEPART(WEEKDAY, GETDATE()) = 1 THEN 'Sunday' ELSE
     CASE WHEN DATEPART(WEEKDAY, GETDATE()) = 2 THEN 'Monday' ELSE
         CASE WHEN DATEPART(WEEKDAY, GETDATE()) = 3 THEN 'Tuesday' ELSE
             CASE WHEN DATEPART(WEEKDAY, GETDATE()) = 4 THEN 'Wednesday' ELSE
                 CASE WHEN DATEPART(WEEKDAY, GETDATE()) = 5 THEN 'Thursday' ELSE
                     CASE WHEN DATEPART(WEEKDAY, GETDATE()) = 6 THEN 'Friday' ELSE
                         'Saturday'
                     END
                 END
             END
         END
     END
END AS Today

1 comment:

Rick said...

select datename(weekday, getdate()) today