Page 1 of 1

selecting date ranges for a single activity

Posted: Mon Apr 16, 2007 5:07 am
by adeel_tariq
a table having two columns one activity and second date

and data is
ACTIVTY DATE
A 01-MAR-07
A 02-MAR-07
A 03-MAR-07

A 15-MAR-07
A 16-MAR-07
A 17-MAR-07
A 18-MAR-07


RESULT REQUIRED
A 1-MAR-07 TO 3-MAR-07
A 15-MAR-07 TO 18-MAR-07


PLZ HELP

Posted: Wed Apr 18, 2007 5:19 am
by admin
What are the basis to group the data. thanks

Posted: Wed Apr 18, 2007 9:23 am
by adeel_tariq
the basis of grouping is activity but if we take the min and max values of date with activity grouping then we will get two values only but wat we want is

the min and max value of every session

say

activity A is done on 3rd,4th ,5 th of march and then activity B started and then activity A is repeated on 15th march and after that activity C started in this case the result shal be

activity A from 3rd of mar to 5th of mar
activity B from 6th of Mar to 14th of mar
activity A 15th of Mar to 15th of Mar
activity C from 16th of Mar to today