日期:2014-05-17  浏览次数:20628 次

求sql语句!!?急啊
表中有日期字段 BeginTime
条件是找出BeginTime在1月30-2月7日之间记录,不考虑年份!!

在线等啊,谢谢各位啦

------解决方案--------------------
试试这个:
select *
from tb
where substring(CONVERT(varchar(10),BeginTime,120),6,5) between '01-30' and '02-07'

------解决方案--------------------
引用:
试试这个:
select *
from tb
where substring(CONVERT(varchar(10),BeginTime,120),6,5) between '01-30' and '02-07'


引用:
select *
from tb
where BeginTime between '2014-01-30 00:00:00.000' and '2014-02-07 2:59:59.997'

求解答啊亲们
------解决方案--------------------
select *
from table
where right( CONVERT(varchar(10),getdate(),23),5) between '01-30' and '02-07'