LABOR AUDIT… review labor detail rec’s with analysis of Lab-head entry to 1st lab-detail
Situation: Employee will clock-in, but (perhaps) not log-into a job immediately.
This is OK, if they clock-in before shift-start, starting lab-detail close-to shift begin
BAQ link Lab-Head to Lab-detail
Lab head has a Seq # and Lab-detail has a seq# per each record against job/op, therefore the lab-dtail lowest seq # per each lab-head would be the 1st labor-detail against JOB/op.
Employee works 5 days this week. ERGO 5 lab-head recs, each with an increasing and unique lab-head seq #. Per each lab-head, the Lab-detail recs have increasing seq #'s.
SQL does have a min-date function… but the date in the labor tables does not include TIME. The time(s) are stored in separate fields. With all DATES being the same… can’t attain results based on date fields.
How to limit the SUB-QUERY in the BAQ to ONLY the lowest seq # of the Lab-detail per each Lab-Head Seq # ???
As for your suggestion:
a min(labordtl.laborseq) and group by laborhed.laborhedseq work?
While I have a good number of years of EPICOR, just getting deeper into BAQ’s, etc…
Any guidance on deploying this tidbit?
I have access to 3.1.400 EPICOR ICE manual but it is a lot to digest…
Table LaborHed joined to LaborDtl.
Display fields LaborHed.LaborHedSeq (check the groupby checkbox on the display fields)
Create a calculated field, label it, make it an int, use “MIN(LaborDtl.LaborSeq)” in your expression without the quotes.
See if that gets you the basic results you’re looking for. If so you should be able to build it from that point on. Just remember any additional non aggregated fields will need to be grouped.