If found this question which really exactly like my need the only problem its my range of time is 21:00 to 5:00 am!
Specific Time Range Query in SQL Server
I need a query for the whole between 21:00 to 05:00
but i made a query the problem is my query return 21:00 to 23:59 for the month
Select BeginServiceTime,FinishServiceTime From table where
(BeginServiceTime between '2015-07-01' and '2015-07-31') and
DATEPART(hh,BeginServiceTime) >= 21
And i need to make another one for the 00:01 to 05:00 like :
Select BeginServiceTime,FinishServiceTime From table where
(BeginServiceTime between '2015-07-01' and '2015-07-31') and
DATEPART(hh,BeginServiceTime) =< 5
the question : how can i make both in 1 query?