I need to 2 different sums of the same field, separated by a field that has "Yes" or "No". I couldn't find a way to do it with just a calculation, so I went to do it the hard way with scripts. It goes to a blank layout, performs find (where "bid ID == $Bid Id", and "Is Manufacturer Rebate = Yes"(or "No")). The script did not produce the right numbers. I have (many times over) checked that the previous fields are working correctly and producing the right numbers, so it is just this script that is bad.

(Totals table contains all my math. Yes, "Total Round X" is a bad naming scheme, when seen as just text)

(ALL Credits table contains all the credits)

(Credits table contains all the credits added to bid).

I have to separately do a sum for manufacture rebate and non; because the manufacture rebate applies to the final cost as it comes instantly from manufacturer- while the non-manufacture rebates do not come right away and can take many weeks to arrive (4-6) and doesn't apply to the final cost.

(I am honestly unsure if Sum applies to only found records or all)

Sum does not work like you have set up in this script.

Sum can be used three ways:

Sum ( Field1 ; Field2 ; field3 ) ---> This sums these three fields from the same record

Sum ( Repeating field ) ----> This sums the different repetitions of this field

Sum ( relatedTable::Field ) ---->sums field over all related records

Note that none of these sum across the found set.

Sum ( Field ) just returns the value of "field".

Use a summary field instead of Sum

And there are a number of ways to get these totals without using a script