Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Date functions - leave out weekends?

730298Oct 26 2009 — edited Oct 26 2009
I need a little help with something that I'm hoping there's a way to do in SQL...

The gist of the problem is that I need to calculate a time-to-service/SLA kind of thing that leaves out weekends from the calculation. Say that you have a 24-hour window to respond to a request to do something... A request gets logged at noon on Friday, and you do it at noon on Monday. That's considered on-time...but obviously if you just subtract one date from the other, there's the 48-hour period of the weekend involved, and that has to be eliminated from the calculation. Sort of a business-week date arithmetic.

...the 2nd part that I'm sure will come up is how to eliminate holidays from the calc - Christmas may come on a Wed. for example, and that would probably have to be left out too. Will be happy to start with leaving weekends out though if someone has a good way to do that.

Any help is appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2009
Added on Oct 26 2009
6 comments
494 views