hi
i have to search based on opening and closing times of shops. e.g. opening time of one is from 9 am to 11 pm another can be 5 am to nextday 2 am. e.g of sample data below
ShopID open time close time
shop1 10am 11pm
shop2 6am 10pm
shop3 6am 12am
shop4 4am 2am
shop5 12am 12am //open 24 hours
how can i write the query to find out which shops are open between 6 am and 3am nextday. The query should only return shop5. What is the best way to resolve the problem. bascially from the query users can find which shops are open at what time