Get Labor Details for the Last Few Jobs

Good afternoon,
I am trying to figure out how to pull labor details for the last two jobs that a part has been run on. I don’t care if the jobs are open or closed. I am comparing operation times going into the past, and I want to make sure I am not pulling in very old jobs as their operations may not align well with the new jobs.

I know I can look at a job’s req date or due date, but I really want to just look back to the last 2 or three jobs regardless of the date. I need to do this in a BAQ. I enter an assembly level part number to begin.

How can I pull details for just the last two or three jobs a part was run on? What fields can I use to determine which are the last two or three jobs?
Thanks!
Nate

Hmmm… might get interesting
Off the top of my head I might try subqueries using PartTran and LaborDtl tables

  • grouped by jobnums and calculate maxdates (and maybe only certain transtypes)
    — TBD if then possible to select jobs you’re looking for
    ------- if their maxdate is <= maxdate and >= maxdate - 2?
1 Like

@Randy has a nice example with another table, but you should be able to get to the last two jobs from here by altering the sort.

Top 5 Products sold - ERP 10 - Epicor User Help Forum (epiusers.help)

3 Likes

Nice find Mark.

1 Like

Wish I’d posted that BAQ here now. I need to rebuild it at my current company. Lucky it’s not too hard to build.

1 Like

Thank you all for these examples. I will take a look and let you know if I get it working.