December 10, 201510 yr LS, I am puzzled. I have this simple sql : Let ([ key = FORR::k_order_line_id ; SQL = "Select sum(amount) " & " from journal_line jl" & " where jl.k_order_line_id = ?" & " and jl.ledger = '2053' " ] ; ExecuteSQL ( SQL ; "" ; "" ; key ) ) Data viewer returns : 1707.5 ( 1895 - 187.50 ) Calculated field returns : 170750 <- wrong. Calculation is number, unstored. When I don't have decimals the sum result of both are the same. Any ideas as to why ? TIA, Joost Edited December 10, 201510 yr by Joost Miltenburg
December 11, 201510 yr And this is not just a field formatting issue on the layout? IOW you get the same result when you click into the field.
December 11, 201510 yr Author Hi Wim, no, this is not an formatting issue. When I export the data to excel the value is just plain wrong ( 170750 instead of 1707.5 ) I find this very odd.
December 13, 201510 yr SQL may be a reserved word? try changing the variable name to something other than SQL. https://www.drupal.org/node/141051 try Let ([_key = FORR::k_order_line_id ;_SQL = "Select sum(amount) " & " from journal_line jl" & " where jl.k_order_line_id = ?" & " and jl.ledger = '2053' " ] ; ExecuteSQL ( _SQL ; "" ; "" ; _key ) ) Edited December 13, 201510 yr by Kris M
December 17, 201510 yr Author Unfortunately that did not help. Did not solve issue, but as I need a solution now, I just created a relationship and summed the field. Result as expected.
Create an account or sign in to comment