Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remainders

Status
Not open for further replies.

Kakoivini

Programmer
Dec 2, 2004
15
US
Greetings all,


CR9, Informix procedure, Unix database.

I am attempting to get the loose quantities on a report to calculate correctly and not having much success. I need the report to first figure out what the remainder is per item, then sum that remainder for a total to be printed on the report.

item 1
qty= 140 / (full pallet count) 35 = remainder of 0
itme 2
qty = 150 / 40 = 30
item 3
qty = 256 / 30 = 16

print total 46 as Loose Qty Ordered.

The qty is determined thru the following:
whileprintingrecords;
shared numbervar sumOutbound_CPU :=
If {@fldTransact}="SHIP" Then
if {throughput.(expression):10}="CPU" and not ({throughput.(expression):13}="SHIPSHORT") then
sumOutbound_CPU +{throughput.(expression):9}
else
sumOutbound_CPU
else
sumOutbound_CPU;

What I tried was this:
shared numbervar sumLooseQty :=

if onlastrecord and (previous({throughput.(expression):3})={throughput.(expression):3}) and {throughput.(expression):18}>0 then
sumLooseQty:= sumLooseQty +Remainder({@qtytest},{throughput.(expression):18})
else
If not(next({throughput.(expression):3})={throughput.(expression):3}) and {throughput.(expression):18}>0 then
sumLooseQty:= sumLooseQty +Remainder({@qtytest},{throughput.(expression):18})
else
sumLooseQty;

I am getting an incorrect amount.
 
So am I like on the do not help list? Or am I asking stupid or incomplete questions?
 
Post formulas for {@fldTransact} and {@qtytest}

Have you tried using running totals?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top