on 01-19-2005 12:41 PM
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The syntax you are using for the variables is designed to return a string. There is an additional parameter '.NUMBER' you can use to get SBO to treat the variable as a numeric item. I have included a simple example below (assumes value of UDF is 5).
SELECT $[ORDR.U_AZU_SPHR]
- Treats it as a string: select '5'
SELECT $[ORDR.U_AZU_SPHR.NUMBER]
- Treats it as numeric: select 5
This might solve your problem.
Regards,
John.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.