2013-11-22 74 views

回答

1
SELECT * FROM your_table 
WHERE (DateCol=cast (GETDATE() as DATE) AND TimeCol<'17:00:00') 
OR (DateCol=cast (GETDATE()-1 as DATE) AND TimeCol>'17:00:00') 
+0

難道不應該或者是和? –

+0

不,因爲這是不可能的,因爲昨天和今天不能屬於同一時間。 – Kuzgun