Oracle PL-SQL dates
Posted on 2014-11-25
I'd like to calculate the last 4 weeks (only business days Mon-Fri), but the code below gives me the last 4 weeks starting from 10/22, instead of 10/27:
p.fnd_complete_dt >= trunc(sysdate - 28,'WW') and p.fnd_complete_dt < trunc(sysdate,'WW')
I also need to do the same for the last 12 weeks:
p.fnd_complete_dt >= trunc(sysdate - 84,'WW') and p.fnd_complete_dt < trunc(sysdate,'WW')
Further, I am trying to calculate the business days (Mon-Fri) between two dates. Is there a way to do it better than my code below which would include weekends?
(a.fnd_complete_dt - a.appvl_dt).
Thanks for your tremendous assistance.