Hi,
I need to write a query that retrieves records from table based on the date range that i specify.
eg: My table will have a CouponStartDate and CouponEndDate. When i specify the date range i need to get all the Coupons that were active during that period. I have tried this query like this
select * from tblCoupon where WHERE (((StartDate)>=[Enter Start Date] And (EndDate)<=[Enter End Date])) or (((EndDate)>=[Enter Start Date] And (EndDate)<=[Enter End Date]));
when i run this query with this range (01/20/04 and 02/15/04)i am getting all the records that started or ended between these dates but the Coupons started before 01/20/04 and ended after 02/15/04 are not coming, but those are still active in this date range, so i need to get them. How to solve it?
I need to write a query that retrieves records from table based on the date range that i specify.
eg: My table will have a CouponStartDate and CouponEndDate. When i specify the date range i need to get all the Coupons that were active during that period. I have tried this query like this
select * from tblCoupon where WHERE (((StartDate)>=[Enter Start Date] And (EndDate)<=[Enter End Date])) or (((EndDate)>=[Enter Start Date] And (EndDate)<=[Enter End Date]));
when i run this query with this range (01/20/04 and 02/15/04)i am getting all the records that started or ended between these dates but the Coupons started before 01/20/04 and ended after 02/15/04 are not coming, but those are still active in this date range, so i need to get them. How to solve it?