I am working on a hotel room booking project. I have a table in which i create a discount promotion. In this table I have PromotionStartDate and PromotionEndDate. For example I have a promotion which is starting from 03-aug-14 to 07-Aug-14. If a person search availability of room from 1-Aug-14 to 10-Aug-14, so the query should show the result that discount will be applicable on 3,4,5,6 and 7 of August.
The result which I want should be like :
Dates : DiscountStatus
01-Aug-14 : No
02-Aug-14 : No
03-Aug-14 : Yes
04-Aug-14 : Yes
05-Aug-14 : Yes
06-Aug-14 : Yes
07-Aug-14 : Yes
09-Aug-14 : No
10-Aug-14 : No