Could somebody help me with this problem? SBO 6.5
What data type works properly to make aritmetics operations? I have 2 UDF in OINV table and i want to multiplicate them and divide by 100. I've try many things but system doesn't send me any error.
Only i´ve obtained and error when udf's data type is "Units and Totals" subtype "Amount" and i've checked this select with many data types.
I have this select:
SELECT (($[OINV.U_DtoAHM] * $[OINV.U_ImpAnt)/100) FROM OINV T0 WHERE T0.DocNum=$[OINV.DocNum] FOR BROWSE
to calculate a new discount in the invoice card but SBO doesn't calculate it.
And a stranger behavior:
With numeric (integer, I think) data type i obtained next results:
SELECT (($[OINV.U_DtoAHM] * $[OINV.U_ImpAnt)/100) FROM OINV T0 WHERE T0.DocNum=$[OINV.DocNum] FOR BROWSE
Doesn't work.
SELECT ((1000 * $[OINV.U_ImpAnt)/100) FROM OINV T0 WHERE T0.DocNum=$[OINV.DocNum] FOR BROWSE
Works properly.
AND
SELECT (($[OINV.U_DtoAHM] * 1000)/100) FROM OINV T0 WHERE T0.DocNum=$[OINV.DocNum] FOR BROWSE
Works properly.
Incredible...
Alberto Hermida
Thanks.
Message was edited by: Alberto Hermida Mouriño
I had similar problems with formatted searches some time ago.
I solved it casting the values obtained.
Here you have a sample of a formatted search that works:
SELECT CAST($[$38.U_PrixAch] AS numeric(19,6))/(1-CAST($[$38.U_TauxM] AS numeric(19,6)))
Hope it solves your problem
Trinidad.
Add a comment