sql - Retrieve records falling within a daily time range across a given month -
my table contains fields store
- ticket
- sale date/time
- price
i need on how select tickets sold between 8:00 , 12:00 pm on day-to-day basis entire month, without including sales between 12:01 pm , 10:00 pm.
simple way deal events in given hours of day use datepart
select * tickettable datepart(hh, saledatetime) between 8 , 11
Comments
Post a Comment