I have a table which has two columns FromDate and ToDate.
Eg.
ID From Date To Date
1 2012-01-02 2012-01-07
2 2012-01-08 2012-01-14
3 2012-01-15 2012-01-21
4 2012-01-22 2012-01-28
What I am trying to do is when I pass new From and To dates, to check against this table to if the new date range fall under any of this dates finding the associate ID value. (I am not passing the exact from and Todate values which are already in the table)
For example if I pass 2012/01/25 as From and 2012/02/03 as To Date it should return 4.
I am not quite sure how to approach this problem.
Any help ?
Thanks
1 Answer