I have the following where clause in my query:
(DATEPART(hh,[AuditInsertTimestamp]) >= 17
OR DATEPART(hh,[AuditInsertTimestamp]) <= 6)
So Audit Insert Timestamp is greater or equal to 5PM and Audit Insert Timestamp is less than or equal to 6AM. Where really what I want is Audit Insert Timestamp is less than or equal to 5:30AM. I was thinking about adding:
--AND DATEPART(mi,[AuditInsertTimestamp]) < 30)
But that would only give me times with minutes below 30 correct? What would be the best way to get <= 5:30AM?
1 Answer