I'd have to see a database diagram to help out here. But some suggestions to get you going:
Are jobs tracked in a separate table?
If a job is completed, is there a "jobCompleted" boolean column that tracks that?
Are you only doing 1 job at a time? (you won't do 4 jobs when 73/75 are complete, and overflow into 77/75)
If yes to all then it's super simple (untested query):
Code:
SELECT TOP 1 jobID (select other columns if you want)
FROM tblJobs
JOIN tblOrders on tblJobs.FK = tblOrders.PK (join other columns if you want)
WHERE jobCompleted=FALSE
ORDER BY tblOrders.orderNum ASC, tblJobs.jobNum ASC
I'm basing that query on absolutely nothing, lol. Please provide some table structures so I can help better.
EDIT: Do you provide a job number on the invoices (for example "order #1 job #1", "order #1, job #2", etc.)? Or do you just bill for unidentified jobs (example "order #1 job", "order #1 job", etc.), and don't need to identify them?