日期:2014-05-17  浏览次数:20569 次

sqlserver 2008 dateadd函数问题
select booking.id as id,orderno ,productName as pno,phone as user1,quantity as pnumber,productCombo 
as taocan,unit as pjiage ,residual as zjiage,privilege as pfanxian,CustomerName as senduser,case AddedService 
when '一年延' then  '一年'  when '二年延' then  '两年' else AddedService  end  as  fuwu,tel,mail 
as email,CustomerAddress as address,residual as jiage, 
case booking.lasteditdate > dateadd(day,-7,getdate())
when true then '交易成功' else '确认收货' end 

case booking.lasteditdate > dateadd(day,-7,getdate())
提示:'>' 附近有语法错误。

when true then '交易成功' else '确认收货' end 
提示:列名‘true’无效。
找了很久,就是没找到答案,现在求各位大大帮忙看看。谢谢!
sql?server??2008 ?dateadd函数

------解决方案--------------------
case when booking.lasteditdate > dateadd(day,-7,getdate())
then '交易成功' else '确认收货' end