How can I write the last workday?
For the actual day there is the function SYSTIMESTAMP but what about the last work day?
Do you mean last working day???
If yes, You may need to check the weekday of actual day 1st.
Check weekday Logic:
Weekday = (Monday to Friday), use actual day,
Weekday = (Saturday), use actual day - 1 day
Weekday = (Sunday), use actual day - 2 days
Yes, I meant last working day.
I understand what you write but I don't know how to build it.
I mean, how do I write it literally? And more specificaly, how do I do the substraction?
The following expressions return the day of the week for each date in a port:
TO_CHAR( DATE_PROMISED, 'D' )
DATE_PROMISED RETURN VALUE
04-01-1997 12:00:10AM '3'
02-22-1997 01:31:10PM '7'
10-24-1997 02:12:30PM '6'
1 = Sunday
2 = Monday
3 = Tuesday
And you have Last_Day function to get the last date of the month.