I am trying to consolidate data from a proprietary database that was built for a DOS based point of sale application. The database is basically a series of flat files. I have managed to get the data into SQL Server but I am having trouble getting the Joins correct so that the data shows the way I need.
For instance here are three tables
The results I would like to get is to list all the employees along with a total of Worked Hours and the amount of Cars Worked on.
The Query looks like this
The results I get only show one employee over and over (EECODE is the Employee number).
What I am doing wrong?
For instance here are three tables
The results I would like to get is to list all the employees along with a total of Worked Hours and the amount of Cars Worked on.
The Query looks like this
Code:
SELECT
dbo.EENAME.EECODE,
dbo.EENAME.NAME,
dbo.vHoursWorked.TOTAL_HRS,
dbo.vCars.CarCount
FROM dbo.vHoursWorked INNER JOIN
dbo.EENAME ON dbo.vHoursWorked.EECODE = dbo.EENAME.EECODE INNER JOIN
dbo.vCars ON dbo.EENAME.EECODE = dbo.vCars.EECODE
The results I get only show one employee over and over (EECODE is the Employee number).
What I am doing wrong?