Hi,
I am using the following two sql statements:
According to me the sum of Result(0) should be equal to Result(1), however it isn't. Most of the time there is a few Euro difference. What do I wrong?
The rounding is done in the flexible table module with this code:
Attached a demo program which creates a dummy database of 5000 rows so that you can create an overview yourself.
Also a print screen where you can see that the sum of the turnover per salesmanager is not equal to the total shown the header.
I am using the following two sql statements:
B4X:
Result(0) = "SELECT SalesManagerCode AS 'Sales Manager Number', SalesManagerName AS 'Sales Manager Name', IFNULL(SUM(TurnoverEuro),0) AS 'Turnover', IFNULL(SUM(ScheduledOnHandEuro),0) AS 'Scheduled on hand' FROM " & Main.TABLENAME0 & " WHERE FiscalYear = 'V9/" & Main.fy & "' GROUP BY SalesManagerCode, SalesManagerName ORDER BY SalesManagerName"
Result(1) = "SELECT IFNULL(SUM(TurnoverEuro),0) AS 'Turnover', IFNULL(SUM(ScheduledOnHandEuro),0) AS 'Scheduled on hand' FROM " & Main.TABLENAME0 & " WHERE FiscalYear = 'V9/" & Main.fy & "'"
According to me the sum of Result(0) should be equal to Result(1), however it isn't. Most of the time there is a few Euro difference. What do I wrong?
The rounding is done in the flexible table module with this code:
B4X:
lbls(I).Text = NumberFormat2(values(I),1,2,2,True)
Attached a demo program which creates a dummy database of 5000 rows so that you can create an overview yourself.
Also a print screen where you can see that the sum of the turnover per salesmanager is not equal to the total shown the header.