try thisselect * from hotel_price where end_date <='2002-12-16' and room_id = 6

解决方案 »

  1.   


    建议:
    datediff(day,2002-12-16,end_date)>=0
      

  2.   

    select convert(char(10),end_date,120)>='2002-12-26'
      

  3.   

    我开始用的是datediff(d,2002-12-25,end_date)>=0
    但是根本不器作用
    所有我改用了这种土方法,还是不行,
    liujianjun的方法我还没有用过
    试试再说。谢谢
      

  4.   

    呵呵,四星犯错了,
    datediff(day,'2002-12-16',end_date)<=0
      

  5.   

    你没加',系统会处理成1905-05-29 00:00:00.000
    用select convert(datetime,2002-12-16)
    得出
      

  6.   

    不对。但是再sql server 联机丛书上面试这么写的啊 
    没有要单引号啊