Help modifying Sales vs Cost closed job report posted by Denny49

I am modifing the Sales vs Cost closed job report posted by Denny49
so that we can look at just open jobs. very straight forward easy to
undersatnd report.

instead of using the ship quantiy I want to capture the quantity made
at the last completed sequence as well as what sequence was last
completed.

I have figured a way to capture the quantity made after the first
sequence using the following calculation, QtyOpseq1 is equal to IIF
(APSNextOp = -1,JobOper.QtyCompleted , 0). I'm not quite sure how
this calc works but it does. (What does APS stand for any waylooking
into the data dictionary the I should be using -2 but this just
returns a 0 evry time?)(why does this calc work with -1 and not -2?).

Since we do not always enter data correctly I have another function
that defaults to the IIF(QtyOpseq1 > 0,QtyOpseq1,JobHead.ProdQty)and
use the scheduled ProdQty. Now for some reason we don't always run
the secheduled prod quantity (some times more sometimes less)so i
really need to capture the the quantity completed during the last
completed operation sequence. Does any oen know how to capture this
quantity?

It seamed like a simple modifiaction and I am almost there. Can
anyone lend me a hand.

How do I capture the last completed sequence? and print it?

Thanks again

Jim