select * from 表名 where convert(varchar(13),[time],120)<convert(varchar(13),getdate(),120)

解决方案 »

  1.   

    试试看哦,我以前就这样可以做到。呵呵!
    Select * From table_name Where time<#2007-1-30 18:00:00#
      

  2.   

    select * 
    from 表名 
    where datepart(hh,[time])<18
      

  3.   

    --每天18点以前的数据select * 
    from 表名 
    where datepart(hh,[time])<18
      

  4.   

    select * from 表名 where right(convert(varchar(13),[time],120),2)<='18'
      

  5.   

    select * 
    from 表名 
    where datepart(hh,[time])<18 
      and [time]>='2006-12-01' 
      and [tim]<'2007-1-31'
      

  6.   

    select * 
    from 表名 
    where datepart(hh,[time])<18 
    and left(time,9)>='2006-12-01' and left(time,9)<'2007-1-31'
      

  7.   


    select *
    from ta where  convert(varchar(12),[time],108)<'18:00'
      

  8.   

    select *
    from ta 
    where  convert(varchar(5),[time],108)<'18:00'
    and
    convert(varchar(10),getdate(),120) between '2006-12-01' and '2007-01-30'