October 26, 201015 yr Today I discovered that a find script that I've been using for years is suddenly not returning expected results. Our database tracks our company's orders, payments, etc. Occasionally I run a script that searches for invoices whose total due is greater than 0. This is result I got when running the script today. I knew it was messed up because a) the first line with a zero total was returned and : other invoices that I knew were unpaid did not appear. And when I do a manual search for either 0 or >0 or 0 and omit, in every case I don't get what I expect. Why would a search for "0" include "396" and "1971" and "2895.75" for example? The database is set up with a table for line items, each line item has an "Item Total" field that is a calculation of "Quantity" times the "Actual Cost Each" (which is the unit price less any discounts). Line Item records are connected to an Invoice table, and in the invoice table is a "Sum Total" field, a Sum of the Line Items' "Item Total" fields. Then a "Grand Total" calculation adds the sum total to a shipping and a tax field. Invoices are connected to a Payments table, and each invoice record also has a "Total Payments Received" field which is a sum of the PaymentAmount field from the Payments table. Finally, the "Total Due" field subtracts the "Total Payments Received" from the "Grand Total". I search this "Total Due" field for numbers greater than 0. But I'm getting these wacky results to my searches now. Any advice for how to track this down?
October 27, 201015 yr I've experienced a similar issue with a similar structure, and found that restarting the server resolved the issue. I'm not sure this counts as a "fix", but it seems to work.
Create an account or sign in to comment