日期:2014-05-18  浏览次数:20847 次

如何把日期变为英文的星期几
比如说把2012-01-05变为英文的星期几

------解决方案--------------------
case when 

先吃饭。
------解决方案--------------------
SQL code
select case when datepart(weekday,getdate()) = 1 then 'SUN'
            when datepart(weekday,getdate()) = 2 then 'MON'
            when datepart(weekday,getdate()) = 3 then 'TUE'
            when datepart(weekday,getdate()) = 4 then 'WED'
            when datepart(weekday,getdate()) = 5 then 'THU'
            when datepart(weekday,getdate()) = 6 then 'FRI'
            when datepart(weekday,getdate()) = 7 then 'SAT'
       end