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?