I had a customer contact me that a report was randomly "missing data" and have tracked down the problem to a single SQL query. the problem is that some items that logically match the WHERE clause don't get selected. I have put together a reverse logic of that statement below by changing the = to != . I have attached a very small subset of this clients data that shows the problem. Using the attached file which contains 4 orders none of which should get selected using the statement below;
SELECT * FROM orders_tbl WHERE (ord_total+discount-tax1-tax2-tax3-tax4-delivery_tax-delivery_fee)!=subtotal;
However, record #1 gets selected. If you change the != back to an =, then you get the remaining 3.
I have updated to the latest SQLite dll file, and still get this problem with this data set. I have manually looked at all of the data and did the math and they should all be treated the same way. Can anyone see a reason or something that I am missing that is causing this issue?
Thanks in advance.
-Scott Slater
SELECT * FROM orders_tbl WHERE (ord_total+discount-tax1-tax2-tax3-tax4-delivery_tax-delivery_fee)!=subtotal;
However, record #1 gets selected. If you change the != back to an =, then you get the remaining 3.
I have updated to the latest SQLite dll file, and still get this problem with this data set. I have manually looked at all of the data and did the math and they should all be treated the same way. Can anyone see a reason or something that I am missing that is causing this issue?
Thanks in advance.
-Scott Slater