select 日期,case when   DATENAME(weekday, 日期')= 'Saturday' or  DATENAME(weekday, 日期')= 'Sunday'     then '休息日'
  else '工作日' end as 工作安排
from 表1

解决方案 »

  1.   

    update tab 
    set 工作安排=case datepart(dd,日期)%6  
                  when 0 then '休息日'
                  when 1 then '工作日'
                  when 2 then '工作日'
                  when 3 then '工作日'
                  when 4 then '工作日'
                  when 5 then '休息日'
                 end                      
    from 表1
      

  2.   

    你可以选择任意一个起始日假设为'2004-01-01'且为工作日的开始,
    通过如下可以生成任何时候的工作安排;update tab 
    set 工作安排=case datediff(day,'2004-01-01',日期)%6  
                  when 0 then '休息日'
                  when 1 then '工作日'
                  when 2 then '工作日'
                  when 3 then '工作日'
                  when 4 then '工作日'
                  when 5 then '休息日'
                end