dimanche 15 mai 2016

Get records today which satisfy two date ranges and within a specific timing in SQL server

I have following [RestaurantOffer] table. Offers, which is valid only within two date ranges (i.e FromDate and ToDate) and at a particular timing(FromTime,ToTime).

enter image description here

So I want to write a query which would give me all Offers on current date(Today) and the time will be more than current Time(Today's Current Time). Because I don't want to get the expired Offers.

Database :

FromDate(date),
ToDate(date),
FromTime(time),
ToTime(time)

Aucun commentaire:

Enregistrer un commentaire