I have a query limited by a date range:
select * from mytable
where COMPLETIONDATE >= TO_DATE('29/06/08','DD/MM/YY')
and COMPLETIONDATE <= TO_DATE('29/06/09','DD/MM/YY')
The table is a log for activities for a ticket system. The content may be something like:
ticket_id|activity|completiondate
1 1 some
1 2 some
1 3 some
1 4 some
2 1 some
2 2 some
2 3 some
2 4 some
That way I know when each activity was completed.
My problems is, if the completiondate
of the first activity happens "before" the date range I loss that info:
where completiondate >= 1 jul 09 and completiondate <= 30 jul 09
ticket_id |activity|completiondate
123 3 1 jul 09
123 4 2 jul 09
In this case I have lost the dates for activity 1 and 2 which took place on june 30 or before.
How can I, at the same time limit the date range of the items I want to show, but also include dates from the same tickets beyond the date range?
This is for a tickets report so I have to see:
Tickets from jun 1 - 30 :
Page won't load, received: march 20, fixed: jun 15
Change color, received: jun 5, fixed: in progress...
etc.