calculate total number of days in specied dates

guspice

New Member
i have one table with two columns as shown in picture
ja1CB.jpg
table columns names are (MAXDATE,AMOUNT).if you see we have \[code\] 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.\[/code\]at the execution of page user enter the start and end date.for example, if user put\[code\] start date: 18-jan-2010 end date: 23-jan-2010\[/code\]then he has 2 dates in first options and 3 dates in second options.what i want to calculate in sql\[code\]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)\[/code\]Thanks
 
Back
Top