i have one table with two columns as shown in picture
table columns names are (MAXDATE,AMOUNT).
if you see we have
first date range (from current date to 20-jan-2010)
second date range from 20-jan-2010 to 30-jan-2010
3rd range is from 20-jan-2010 to 31-jan-2010.
at the execution of page user enter the start and end date.
for example, if user put
start date: 18-jan-2010
end date: 23-jan-2010
then he has 2 dates in first options and 3 dates in second options.
what i want to calculate in sql
1. how many days in first range (if any this depends on supplied dates from user)
2. how many days in 2nd range (if any this depends on supplied dates from user)
3. how many days in 3rd range (if any this depends on supplied dates from user)
Thanks