merging and sum two text boxes

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
= EmployeesFillOrderQuery1Auto_OID) INNER JOIN EmployeesFillOrderQuery2Auto
ON ShipAddress.OID = EmployeesFillOrderQuery2Auto_OID
GROUP BY ShipAddress.EIDC, ShipAddress.EIDC2
ORDER BY Sum(EmployeesFillOrderQuery1Auto.SumOfTWeightUnits) DESC;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top