create or replace function fun_workday(startdate in varchar2,
enddate in varchar2)return number
IS
TOTALVALUE NUMBER;
begin
select count(*) into TOTALVALUE
from ( select rownum rnum
from all_objects
where rownum <= to_date(enddate,'yyyy-MM-dd') -
to_date(startdate,'yyyy-MM-dd')+1 )
where to_char( to_date(startdate,'yyyy-MM-dd')+rnum-1, 'D' )
not in ( '1', '7' );
return TOTALVALUE;
end;
例如:查看7月份的工作日:
select fun_workday('2014-7-1','2014-7-31') from dual;
结果为:23
&spm=1001.2101.3001.5002&articleId=84624516&d=1&t=3&u=48a7ff675ed44fbcad36175a30f523d9)
2039

被折叠的 条评论
为什么被折叠?



