Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> # of weekdays before sysdate?
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...
--
![]() |
![]() |