Q
qutwah
Unregistered / Unconfirmed
GUEST, unregistred user!
有一表记录如下:<br>Autoid Employeeid Kqtime<br>1 1 2008-02-16 08:01:00<br>2 1 2008-02-17 1:05:00<br>3 1 2008-02-17 08:01:00 <br>我想查询所有记录KqTime值在当天23:30:00至第二天01:30:00的记录,我写了下面语句,但查询不到结果,请问各位,该如何修改下面语句实现我想要的需求呢?<br>Select * from KqRecord Where (Employeeid=1) And <br>(Cast(KqTime As DateTime) Between CAST(Convert(Varchar(10),KqTime,120)+Space(1)+'23:30:00' AS DATETIME) And <br>CAST(Convert(Varchar(10),KqTime,120)+Space(1)+'01:30:00' AS DATETIME))