I am novice to Access and ran into dillema. I am trying to pull necessary data via query from three tables however getting dupes as a result.I tried using Distinct in SQL however it is not helping with dupes.
I have these tables:
PayrollData.tbl
JobCode.tbl
NewDeptChart.tbl
Common field that I match are:
From PayrollData.tbl to JobCode.tbl is JobCode field
From PayrollData.tbl to NewDeptChart.tbl is DeptID field
In PayrollData.tbl I have 7000 records
When I match just PayrollData.tbl with JobCode.tbl I get same count.
However, when I then add NewDeptChart.tbl I get over 60000 records in a query result.
Basically the only thing I am trying to bring from NewDeptChart.tbl is SVP Name
Here is my SQL snapshot....Please let me know if this makes sense.
Expand|Select|Wrap|Line Numbers
- SELECT [Payroll Data].[Employee Name]
- , [Payroll Data].Title
- , [Payroll Data].[Job Code]
- , [Payroll Data].Division
- , [Payroll Data].AllocatedCC
- , [Payroll Data].[Pay Date]
- , [Payroll Data].[Pay Code Description]
- , [Payroll Data].Hours
- , Job_Code_Productive.Bucket
- FROM ([Payroll Data] LEFT JOIN
- Job_Code_Productive
- ON [Payroll Data].[Job Code] = Job_Code_Productive.[Job Code])
- LEFT JOIN [New Dept Chart]
- ON [Payroll Data].AllocatedCC = [New Dept Chart].[Dept ID]
- WHERE ((([Payroll Data].[Pay Date])=#7/22/2011#)
- AND (([Payroll Data].[Pay Code Description])<>"shift differential"));