M
Mario
I have a report for employee production based on orders filled. For each
order we assign an employee ( each employee has its own unique number to
identify him), we put his number in a text box [EIDC], there is some orders
that we need to assign two employees and in that case we have a second text
box [EIDC2] that we assign the other employee number, in this case the order
which is based in pounds is split in half for each employee. I need to be
able to have only one total sum for each employee regardless whether they did
all the orders assign to him by himseldf or if some were made by two
employees. Here is the code that I have so far: SELECT Count(ShipAddress.OID)
AS OrdersMade, Sum(EmployeesFillOrderQuery1Auto.SumOfBox) AS TotalBoxes,
Sum(EmployeesFillOrderQuery1Auto.SumOfTWeightUnits) AS TotalWeight,
Sum(EmployeesFillOrderQuery2Auto.SumOfBox2) AS SumOfSumOfBox2,
Sum(EmployeesFillOrderQuery2Auto.SumOfGTWeightUnits) AS
SumOfSumOfGTWeightUnits, ShipAddress.EIDC, ShipAddress.EIDC2
FROM (ShipAddress INNER JOIN EmployeesFillOrderQuery1Auto ON ShipAddress.OID
= EmployeesFillOrderQuery1Aut
ID) INNER JOIN EmployeesFillOrderQuery2Auto
ON ShipAddress.OID = EmployeesFillOrderQuery2Aut
ID
GROUP BY ShipAddress.EIDC, ShipAddress.EIDC2
ORDER BY Sum(EmployeesFillOrderQuery1Auto.SumOfTWeightUnits) DESC;
order we assign an employee ( each employee has its own unique number to
identify him), we put his number in a text box [EIDC], there is some orders
that we need to assign two employees and in that case we have a second text
box [EIDC2] that we assign the other employee number, in this case the order
which is based in pounds is split in half for each employee. I need to be
able to have only one total sum for each employee regardless whether they did
all the orders assign to him by himseldf or if some were made by two
employees. Here is the code that I have so far: SELECT Count(ShipAddress.OID)
AS OrdersMade, Sum(EmployeesFillOrderQuery1Auto.SumOfBox) AS TotalBoxes,
Sum(EmployeesFillOrderQuery1Auto.SumOfTWeightUnits) AS TotalWeight,
Sum(EmployeesFillOrderQuery2Auto.SumOfBox2) AS SumOfSumOfBox2,
Sum(EmployeesFillOrderQuery2Auto.SumOfGTWeightUnits) AS
SumOfSumOfGTWeightUnits, ShipAddress.EIDC, ShipAddress.EIDC2
FROM (ShipAddress INNER JOIN EmployeesFillOrderQuery1Auto ON ShipAddress.OID
= EmployeesFillOrderQuery1Aut
ON ShipAddress.OID = EmployeesFillOrderQuery2Aut
GROUP BY ShipAddress.EIDC, ShipAddress.EIDC2
ORDER BY Sum(EmployeesFillOrderQuery1Auto.SumOfTWeightUnits) DESC;