8 Replies Latest reply: Jan 22, 2018 5:45 AM by youssef belloum RSS

    Join Distinct month number on days

    Paul Damen

      All,

       

      I have 2 tables; 1 table with actual hours people worked per day, and 1 table with scheduled working hours per month:

       

      Actual

      EmployeeID    Day          Hours

      1                      1-1          8

      1                      1-2            8

      2                        1-1            8

      2                        1-2          8

      3                        1-1          8

      3                        1-2          8

      3                        1-3          8

       

      Schedule   

      EmployeeID      Month    Hours

      1                          Jan         184                 

      2                         Jan          184

      3                         Jan          184

       

      How can I join these 2 tables together? If I left Join it will join the total per month on every day. If I join Distinct it will only join 1 time for an employee. What I need is a distinct Join but then distinct per month. How can I achieve this?

       

      Regards, Paul