Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toad - How to get business day

Status
Not open for further replies.

vsprogrammer

Programmer
Jun 26, 2006
40
CA
Hello everyone,

I am writting a sql statement where I have an effective date and I need to -1 from that to get the day before, however, I need only business days (Monday - Friday). Does anyone know how if my effective day falls on Sunday or Monday to get the date for the Friday before? Any help would be appreciated!

Thanks in advance!
 
You could probably just do something like:

SELECT decode(to_char(trunc:)tdate), 'Dy'), 'Mon', trunc:)tdate)-3, 'Sun', trunc:)tdate)-2, 'Sat', trunc:)tdate)-1,
trunc:)tdate)-1)
from dual
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top