2 Replies Latest reply: Oct 3, 2017 8:13 AM by Anand Chouhan RSS

    How to find working days?

    Gaurav Malhotra

      Hi Friends,

       

      I have 3 tables:

       

      1. EmpPresent Table contains below fields:

                a. EmpID

                b. Date of Hire

      2. EmpVacationDetails Table contains below fields:

                a. EmpID

                b. VacationStartDate

                c. VacationEndDate

                d. VacationDays

      3. PublicHolidays Table contains below fields:

                a. HDay

                b. HMonth

                c. Description

       

      Problem:

       

      I want the data in the below format and in 1 table. I am also fine if the output data is even date wise.:

       

      Output:

                a. EmpID

                b. Month

                c. Year

                d. Number of WeekDays

                e. Number of WeekEnds

                f.  Number of Public Holidays

                g. Number of Vacations

                h. Number of Working Days                       

       

      Calculation for

      Number of Working Days = (Number of WeekDays) - (Number of Public Holidays + Number of Vacations)

       

      What should be the best approach?

       

      Feel free if you need sample data for the same or any inputs. Thanks in advance.