Column format is 'YYYY-MM-DD HH:MM:SS'. But I want to search for all rows where that time is between 19:00:00 and 24:00:00
Asked
Active
Viewed 145 times
0
-
1Is the column a date/time column or a string? If a string, why are you storing a date/time as a string? – Gordon Linoff Mar 24 '16 at 12:02
-
It's a datetime column – frebbie Mar 24 '16 at 12:10
1 Answers
0
You can use datepart()
:
where datepart(hour, col) between 19 and 23

Gordon Linoff
- 1,242,037
- 58
- 646
- 786