BAQ Sum JobOper Act Hors

Hey guys I suspect this will be an easy answer but I cant seem to find it searching around. Simply put I want to sum the act prod hours together in a baq report. For example the Baq displays:

Job 1: 0.25
Job 1: 0.10
Job 1: 1.05

What this tells me is job 1 has three ops and the act times of each are listed. However, I want the full time for the job displayed on a singe line which would read:
Job 1: 1.40

Thanks

You need to group by your job num. Remove the act prod hours from the output fields, and instead put in a sum field to aggregate the values. I pull the values from LaborDtl. Something like this should work:

select 
	[LaborDtl].[JobNum] as [LaborDtl_JobNum],
	(sum(LaborDtl.LaborHrs)) as [Calculated_ActHrs]
from Erp.LaborDtl as LaborDtl
group by [LaborDtl].[JobNum]

Thank you Nate!

I am new to calculated fields/SQL. I am still having some trouble. I created a simple test baq with only labordtl jobnum and laborhrs to simplify things. Should I be doing something with the [Calculated_ActHrs] in the second line? I receive an error stating bad SQL statement when I test the BAQ.

You don’t need a whole Query. Just the field. The group by is handled by the check boxes on the column selection screen

sum(yourfield)

this is all you need.

1 Like

Got it, makes sense and that did the trick!

Thank you both

I would think you would be able to shorten that to

JobAsmbl.TLASetupHours +
JobAsmbl.TLAProdHours +
JobAsmbl.LLASetupHours +
JobAsmbl.LLAProdHours

Filter Job Assembly = 0

DaveO

1 Like