select * from online where site_id=1 and LastTime>2006-3-13 5:39:44 order by OnTime desc 
LastTime 数据类型为smalldatetime ,数据库为sql server 2000,为什么这样写不行,郁闷!~~

解决方案 »

  1.   

    select * from online 
    where site_id=1 and convert(char(10),LastTime,120)>'2006-03-13'  
    order by OnTime desc
      

  2.   

    select * from online where site_id=1 and LastTime>'2006-3-13 5:39:44' order by OnTime desc
      

  3.   

    请教下可可,这样行不行呢?
    select * from online where site_id=1 and LastTime>'2006-3-13 5:39:44' order by OnTime desc
      

  4.   

    hehe,看来楼上大侠已经给出答案了:)