Wednesday, April 6, 2011

Filtering by Time in a Query


SELECT CONVERT(VARCHAR(5),[fldDateTime], 108) AS Time, [fldDateTime]
FROM tblDateTimes
WHERE ((CONVERT(VARCHAR(5),[fldDateTime], 108) <= '06:00') OR (CONVERT(VARCHAR(5),[fldDateTime], 108) >= '18:00'))

No comments:

Post a Comment