I have the following SQL

ExecuteSQL (

"SELECT orgName01, field02

FROM table01 WHERE checkBox01 = 1 and id = ?"

;

"" ; ""; table01::id)

I'd like to get the number of field02 formatted with a fixed number of decimals of two, but SQL retrieve the raw number unformatted

This could be the result:

Apekta inc. 123,00

Acme inc. 128,10

....

Thanks for helping

Gianco

It's a little bit convoluted, but you could use something like:

ExecuteSQL (

"SELECT orgName01, STRVAL(INT(field02)) || LEFT(STRVAL(field02 + .001 - INT(field02)), 3)

FROM table01 WHERE checkBox01 = 1 and id = ?"

;

"" ; ""; table01::id)

BTW, if you might have negative values, use something like this instead:

ExecuteSQL (

"SELECT orgName01, STRVAL(INT(field02)) || LEFT(STRVAL(ABS(field02) + .001 - INT(ABS(field02))), 3)

FROM table01 WHERE checkBox01 = 1 and id = ?"

;

"" ; ""; table01::id)

Message was edited by: Greg Lane to include alternate solution for negative values