I have the following tables/columns:
Table Dates:
Columns: Date
contains all dates in a range say from 1.7.15 to 31.7.15
Table EmployeeHours
Columns: EmployeeID, Entrydate, NumberOfHours
in this table an employee can have entries for all dates or just some dates.
I need a query which shows all the dates from Table Dates for each Employee in Table EmployeeHours regardless if there are entries in EmployeeHours for all dates.
Example:
Dates contains 01.07.15, 02.07.15, 03.07.15
Employeehours contains these records:
Employeeid 1 entrydate 01.07.15, NumberOfHours 5
Employeeid 1 entrydate 03.07.15 NumberOfHours 7
Output should be:
Date EmployeeID NumberOfHours
01.07.15 1 5
02.07.15 1 NULL
03.07.15 1 7
I just cannot figure out how to achieve this. Any help appreciated.
Thomas