Hello,
I have googled this extensively, but couldn't find the answer, so decided to post here. I am working in Access 2003. I have a long MonthSalaries table of each employee's daily earnings, a main Employee table with employees' main attributes, and a Fringe table that details their alloted regular and overtime fringe rate based on title. What I want to do is total up the earnings for the month for each employee (done by subquery [SalSub]), join the Employee table to the fringe table (done by [FringeSub]), and then join the subqueries, which would result in fields of RegularSal, OvertimeSal, RegFringe, OTFringe for each employee (final join accomplished by [joinSalFringe]).
This all works out lovely, EXCEPT now that I need to get the actual amounts of fringe paid for regular time and overtime by defining fields for RegularSal*RegFringe and OTSal*OTFringe. I try to accomplish this with the following query:
When I try to do this, I get an error saying that the field EMPLID could refer to more than one table in the from clause. I tried using just EMPLID without specifying the table, I tried using Employee.EMPLID (which is the original table in the group by clause of both the subqueries involved), but I am just not getting it. Can someone please tell me how I should be rererencing the EMPLID field in this three-layer query?
Thank you!
I have googled this extensively, but couldn't find the answer, so decided to post here. I am working in Access 2003. I have a long MonthSalaries table of each employee's daily earnings, a main Employee table with employees' main attributes, and a Fringe table that details their alloted regular and overtime fringe rate based on title. What I want to do is total up the earnings for the month for each employee (done by subquery [SalSub]), join the Employee table to the fringe table (done by [FringeSub]), and then join the subqueries, which would result in fields of RegularSal, OvertimeSal, RegFringe, OTFringe for each employee (final join accomplished by [joinSalFringe]).
This all works out lovely, EXCEPT now that I need to get the actual amounts of fringe paid for regular time and overtime by defining fields for RegularSal*RegFringe and OTSal*OTFringe. I try to accomplish this with the following query:
PHP:
Select
[joinSalFringe].EMPLID,
[joinSalFringe].RegularSal*[joinSalFringe].RegFringe as RegFringePaid
[joinSalFringe].OTSal*[joinSalFringe].OTFringe as OTFringePaid
from
[joinSalFringe]
group by [joinSalFringe].EMPLID;
When I try to do this, I get an error saying that the field EMPLID could refer to more than one table in the from clause. I tried using just EMPLID without specifying the table, I tried using Employee.EMPLID (which is the original table in the group by clause of both the subqueries involved), but I am just not getting it. Can someone please tell me how I should be rererencing the EMPLID field in this three-layer query?
Thank you!