This blog contains Informatica tutorials, Complete reference to Informatica, Informatica Tutorial for Beginners, Informatica Real Time Scenarios with Answers, Informatica Interview Questions with Answers, Informatica FAQ, TIPS for learning Informatica, Learn Informatica online, Informatica Guide for Beginners, DWH Concepts, Informatica scenarios, Informatica Scenario Based Interview Questions with Answers, Informatica scenarios with solutions, Informatica Latest scenarios with answers
Write a query to calculate number of working days between any 2 given dates.
The working days here refer to the count of days excluding Saturdays and Sundays. Let us take the given 2 dates as ’26-Aug-2007′ and SYSDATE. (26th August is my Birthday).
The query looks like:
select count(val) Number_of_working_days from ( select to_number(to_char(to_date(’26-aug-07′)+rownum , ’D')) val, to_char(to_date(’26-aug-07′)+ rownum) date1, to_char(to_date(’26-aug-07′) + rownum, ‘Day’) day1 from all_objects where to_date(’26-aug-07′)+rownum<= sysdate ) where val not in (6,7)