where datediff(dy,YourDateCol,getdate())=1
where datediff(ww,YourDateCol,getdate())=1
where datediff(yy,YourDateCol,getdate())=1

解决方案 »

  1.   

    按你这么说
    前一天应该是
    where datediff(dy,-1,getdate())
    对不对,这样能满足上面的要求吗??
    —————————————————————————————————
    笨鸟未飞
      

  2.   


    where datediff(dy,YourDateCol,getdate())=1

    where datediff(ww,YourDateCol,getdate())=1

    where datediff(yy,YourDateCol,getdate())=1
      

  3.   

    不好意思 yourdatecol是指的字段名吗?
    select * from xs_xsd where datediff(dy,kdrq,getdate())=1
    kdrq是指开单日期的字段名,搜索不出昨天的数据—————————————————————————————————
    笨鸟未飞