>Try the query without the indexes and without set order. That should give you the correct result. Then see about adding the .idx via SET INDEX not via SET ORDER
I put set order to and got
Found a mismatch on I909648COL cRate = 0 laArr[1]= 0.094859333
Found a mismatch on I909609COL cRate = 0 laArr[1]= 0.100000000
Found a mismatch on I909656COL cRate = 0 laArr[1]= 0.100000000
Found a mismatch on I808204COL cRate = 0 laArr[1]= 0.100000000
Found a mismatch on I808205COL cRate = 0 laArr[1]= 0.100000000
Found a mismatch on I807227COL cRate = 0 laArr[1]= 0.100000000
Found a mismatch on I808130COL cRate = 0 laArr[1]= 0.087330233
Found a mismatch on I808228COL cRate = 0 laArr[1]= 0.067779691
Found a mismatch on I808229COL cRate = 0 laArr[1]= 0.067779691
Found a mismatch on I518767COL cRate = 0 laArr[1]= 0.100000000
This is strange since these Inv_No + Salesman do not exist in the table. I've tried to do select and seek in command window and they returned empty results.
Somehow SELECT SUM() finds wrong records. I re-built index Com_Inv earlier today by deleting it first.
If it's not broken, fix it until it is.
My Blog