Creating backups of your database on a regular basis is a good idea.
Not a certainty, just a possibility...
Sometimes, ? marks can be s symptom of corruption.
Sometimes the field is not big enough (wide) to hold the data.
"Ooh! My Record shows just question-marks in all fields, what's that?"
Before you try anything drastic, try clicking into the field. If the question mark disappears and the value displays correctly, you have nothing major wrong with your file. Chances are, in that case, that you need only resized the field to make it wider.
I did finally get this to work, although I am still not sure why I encountered the problem or why the solution I employed worked.
PaymentsTotal is a summary field, I ended up adding a field;
TotalPayments that uses an auto enter calculation (=PaymentsTotal) Then set the BalanceDue and ChangeDue fields like this;
BalanceDue = If ( OrderTotal - OrderPayments::PaymentTotal > 0 ; OrderTotal - OrderPayments::PaymentTotal ; 0 )
ChangeDue = If ( OrderTotal - OrderPayments::PaymentTotal < 0 ; ( OrderTotal - OrderPayments::PaymentTotal ) * ( -1 ) ; 0 )
This now works flawlessly. If anyone out there understands why this is, I would really like to understand better.
We'd need a more complete understanding of the design of your database to do that. I will observe that negative values will require a wider field to properly display the result in most cases and that could be enough to get a ? in a field.