G
gr
Hi, I have a table named tblName which contains three
fields: NameID, Names and Dt
I also have 4 tables showing a Time Recording entry for
each Name. There are 4 tables because there are 4
categories.
I want to make a query to display the Name, Dt and the
total of hours for each category.
e.g.
Name Dt Admin Project Sales Service
John 01/01/2004 2 3 1
John 02/01/2004 1 1
Sophie 01/01/2004 3
The SQL Code of the query is the following, but IS NOT
WORKING!!
SELECT tblName.NameID, tblName.Names, tblName.Dt,
tblTRAdmin.Hours AS tblTRAdmin_Hours, tblTRPrj.PrjHours,
tblTRSales.Hours AS tblTRSales_Hours, tblTRService.Hours
AS tblTRService_Hours
FROM (((tblName LEFT JOIN tblTRAdmin ON tblName.NameID =
tblTRAdmin.NameID) LEFT JOIN tblTRPrj ON tblName.NameID =
tblTRPrj.NameID) LEFT JOIN tblTRSales ON tblName.NameID =
tblTRSales.NameID) LEFT JOIN tblTRService ON
tblName.NameID = tblTRService.NameID;
The problem is that I think some entries are been
duplicated, since I have not all the NameID for every
category (I guess) the proof is that if make a query for
Admin (only) and I get 82 records which is ok. if I filter
the 4 areas query I get 117 records for Admin, by
reviewing the filter results I realize that some admin
entries hours have been duplicated in the query result.
How can I make the 4 categories in one query without
outputting wrong info?
thx!
fields: NameID, Names and Dt
I also have 4 tables showing a Time Recording entry for
each Name. There are 4 tables because there are 4
categories.
I want to make a query to display the Name, Dt and the
total of hours for each category.
e.g.
Name Dt Admin Project Sales Service
John 01/01/2004 2 3 1
John 02/01/2004 1 1
Sophie 01/01/2004 3
The SQL Code of the query is the following, but IS NOT
WORKING!!
SELECT tblName.NameID, tblName.Names, tblName.Dt,
tblTRAdmin.Hours AS tblTRAdmin_Hours, tblTRPrj.PrjHours,
tblTRSales.Hours AS tblTRSales_Hours, tblTRService.Hours
AS tblTRService_Hours
FROM (((tblName LEFT JOIN tblTRAdmin ON tblName.NameID =
tblTRAdmin.NameID) LEFT JOIN tblTRPrj ON tblName.NameID =
tblTRPrj.NameID) LEFT JOIN tblTRSales ON tblName.NameID =
tblTRSales.NameID) LEFT JOIN tblTRService ON
tblName.NameID = tblTRService.NameID;
The problem is that I think some entries are been
duplicated, since I have not all the NameID for every
category (I guess) the proof is that if make a query for
Admin (only) and I get 82 records which is ok. if I filter
the 4 areas query I get 117 records for Admin, by
reviewing the filter results I realize that some admin
entries hours have been duplicated in the query result.
How can I make the 4 categories in one query without
outputting wrong info?
thx!