hazelsisson
Programmer
Hi,
I have a simple query that retrieves appointments from a table. Some appointments are over multiple days; for these the field app_date_end is not null.
Output:
I would like the query to return a row for each date in the range between (and including) the fields app_date and app_date_end.
Preferred output:
I realise it would be easy if I was using a cursor but the query is for use in a report so that's not an option.
It sounds like it should be easy but I'm having a mental block! I think I'll need to use a pseudo-column somewhere but can't quite put my finger on it.
Thanks very much for any suggestions,
Hazel
I have a simple query that retrieves appointments from a table. Some appointments are over multiple days; for these the field app_date_end is not null.
Code:
select a.app_date, a.app_date_end, a.app_id
from m_calendar.appointments a
where a.APP_DATE_END is not null;
Code:
APP_DATE APP_DATE_END APP_ID
--------------------------------
20/03/2006 21/03/2006 20086
I would like the query to return a row for each date in the range between (and including) the fields app_date and app_date_end.
Preferred output:
Code:
APP_DATE APP_DATE_END APP_ID
--------------------------------
20/03/2006 21/03/2006 20086
21/03/2006 21/03/2006 20086
I realise it would be easy if I was using a cursor but the query is for use in a report so that's not an option.
It sounds like it should be easy but I'm having a mental block! I think I'll need to use a pseudo-column somewhere but can't quite put my finger on it.
Thanks very much for any suggestions,
Hazel