Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Selecting from Calendar ??
Dear Raj,
What I have understood,
SELECT ....
WHERE StDt >= Month_Start AND EdDt <= Month_End should do.
But I suppose your problem is not that easy. Therefore if you could give some actual data and a sample required output, from the actual data, it will perhaps help.
Regards,
Alem
-----Original Message----- From: Jamadagni, Rajendra [mailto:rajendra.jamadagni_at_espn.com] Sent: 28 June, 2000 8:52 PM To: Multiple recipients of list ORACLE-L Subject: Selecting from Calendar ?? Hi all, I have a Calendars table ... where we save month_start and month_end date. The start/end dates of these months have no relationship with actual months in Normal (Gregorian) calendars. What I need is a list of month_num, month_start and month_end dates when I provide a start and end date. The table structure is table_cal (year, month, month_start, month_end), for the same of simplicity let's assume this table containsgregorian calendar.
e.g. (based on gregorian calendar_ when I enter 01-15-2000 to 05-10-2000
Expected Result YEAR MONTH START END ---------------------------------------- 2000 1 01-01-2000 01-31-2000 2000 2 02-01-2000 02-29-2000 2000 3 03-01-2000 03-31-2000 2000 4 04-01-2000 04-30-2000 2000 5 05-01-2000 05-31-2000 BTW I can't make use of LAST_DAY or FIRST_DAY as the start /end dates for our months are different from those of Gregorian Calendar months. We use Broadcast calendars, where a month ends on the last sunday e.g. Jun 2000 is May29 - Jun25 and Jul 2000 is Jun26 - Jul30. I have been trying to get this in SQL for a day, but no avail ... I know this can be done in pl/sql, but if I could do this in SQL, it would help as lots of processingReceived on Thu Jun 29 2000 - 03:01:19 CDT