PDA

Click to See Complete Forum and Search --> : [RESOLVED] Summing Fields


Alexus
Jun 4th, 2009, 12:48 PM
Hello All,
I am wanting to create a summary report for workorders for a specific vehicle.
I am wanting to sum the total parts and labor for the workorder creating one record per workorder. Right now I use ROquantity * ROUnitprice which gives me a total but for each part on the workorder. What I want is to sum all the parts on the workorder and then my summary report would show

Date RoNumber WorkDone Total Parts Total Labor

for each work order associated with that vehicle.
I cannot figure out how to total all the parts and labor for this report
Any help would be appreciated.

BillBoeBaggins
Jun 4th, 2009, 12:59 PM
Select WO.ID, WD.Total
from WorkOrders WO
INNER JOIN
(select ID, sum(unit*price) as Total from WorkDetails group by ID) WD ON
WO.ID=WD.ID

Alexus
Jun 5th, 2009, 03:43 PM
Thank you much, it was what I needed