Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3275 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

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 by Joost Miltenburg
Posted

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.

Posted (edited)

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 by Kris M

This topic is 3275 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.