求sql语句!该怎么解决

求sql语句!急急!!!
numid       name                         time
    1           张三         2007-1-30   7:51:00
    1           张三         2007-1-30   13:31:00
    1           张三         2007-1-30   17:51:00    
    1           张三         2007-1-30   18:51:00
    2           李四         2007-1-30   7:51:00
    2           李四         2007-1-30   13:31:00
    2           李四         2007-1-30   18:31:00
    1           张三         2007-1-29   7:51:00
    1           张三         2007-1-29   13:31:00
    1           张三         2007-1-29   17:51:00    
    1           张三         2007-1-29   18:51:00
    2           李四         2007-1-29   7:51:00
    2           李四         2007-1-29   13:31:00
    2           李四         2007-1-30   18:31:00
怎么把表中18点以前的数据查询出来,,,,,,


------解决方案--------------------
--每天18点以前的数据

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

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

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

------解决方案--------------------

select *
from ta where convert(varchar(12),[time],108) < '18:00 '
------解决方案--------------------
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 '