Is there a function I can use in Discoverer to get a count of the weekdays between two dates? I've found an sql solution to get weekdays for the current year but I can't quite figure out how to adapt it to my needs.
solution to get weekdays posted on Metalink:
select count(*)
from ( select trunc(sysdate,'year')+rnum-1
from ( select rownum rnum
from all_objects
where rownum <= to_char(sysdate,'ddd') )
where to_char( trunc(sysdate,'year')+rnum-1, 'd' ) not in ( '1', '7' );
What I have so far:
creation_date
and
attribute10
are my two dates
select count(*)
from all_objects
where rownum <= (select to_char(creation_date,'ddd')-to_char(to_date(attribute10,'YYYY/MM/DD HH24:MI:SS'),'ddd')
from aso_quote_headers_v where quote_header_id = 7313)
-->this returns 14 days which is the total number of days but I need to incorporate a check for weekdays
and to_char(trunc(<date>,'year'),'d') not in ('1', '7')
Is there an easier way to do this?
Discoverer v 4.1.48
Database v 9i
-Tracy