Need help with date range inclusion.
Date: 10 May 94 19:09:30 GMT
Message-ID: <J3i5Lc1w165w_at_vicuna.ocunix.on.ca>
Hello:
I have written a small SQL*Plus script that displays the U.I. data for a given employee. The table contains the U.I. period commencement date, and the U.I. gross amount. I ask my user to enter a from/to date range for reporting, and then generate the listing.
One small hitch, however -- I need to include subsequent U.I. data if the range falls within the U.I. period of Sunday-Saturday. So if an end date of 31-MAY-94 is given as the 'to' date, I need to report data up to and including the next Saturday after the specified date, in this example 04-JUN-94. How is this accomplished? Here is an excerpt of my script so far:
select start_date, ui_gross
from ec_employee_weekly_ui_data
where employee_id = &employee_id
and start_date >= to_date(&from_date,'YYMMDD')
and start_date <= to_date(&to_date,'YYMMDD')
order by start_date;
The change would probably have to be made to the 2nd last line...is a decode statement needed here or something?
Any information would be greatly appreciated. Thanks in advance!
---< MAKE MONEY FAST! Contact Dave Rhodes for details. >--- Steve Frampton E-mail: <frampton_at_vicuna.ocunix.on.ca> Received on Tue May 10 1994 - 21:09:30 CEST