 |
|
Oracle next_day tips
Oracle Tips by Burleson Consulting |
The next_day Oracle date function returns the date of the
day_of_week after date d. day_of_week can be the full name
or abbreviation.
Below, we use next_day() to get the date for the next Monday, next
Friday, and the first Tuesday of next month.
select
sysdate,
next_day(sysdate,'monday') "next mon",
next_day(sysdate,'friday') "next fri",
next_day(last_day(sysdate)+1,'tuesday')
"first tue"
from dual;
SYSDATE Next Mon
Next Fri First Tue
--------- --------- --------- ---------
24-JAN-05 31-JAN-05 28-JAN-05 08-FEB-05
 |
If you like Oracle tuning, see the book "Oracle
Tuning: The Definitive Reference", with 950 pages of tuning tips and
scripts.
You can buy it direct from the publisher for 30%-off and get
instant access to the code depot of Oracle tuning scripts. |