Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> # of weekdays before sysdate?

# of weekdays before sysdate?

From: Doug O'Leary <dkoleary_at_mediaone.net>
Date: Sat, 11 Mar 2000 10:41:45 -0600
Message-ID: <MPG.13343341fd46683498974b@nntp.ce.mediaone.net>


Hey;

Is there a way to identify the number of weekdays since the beginning of the year that's somewhat easier (and, hopefully, more accurate) than I'm coming up with?

What I've got so far is:

--Combining the two:
select (to_char(sysdate,'DDD') - (to_char(sysdate,'WW') * 2)) from dual;

That sql results in 49 (as of Saturday, 3/11/00). However, according to my calendar, there's been 50 weekdays since the beginning of the year. If all else fails, I'll add a fudge factor; however, I'd like a cleaner method of figuring that out...

This bit of ugliness is going to be part of a script that identifies contractors' (particularly mine!) billing percentages. I'd like it to be accurate.

Thanks for any tips/suggestions.

Doug

PS: In case anyone's concerned, I get billed out as a UNIX admin, not an Oracle dba...

--



Douglas K. O'Leary
Senior System Admin
dkoleary_at_mediaone.net
Received on Sat Mar 11 2000 - 10:41:45 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US