Calculate two numeric values
Kulvir
I would like to calculate two fields and return a value. This works as long as the doctotal [%N;29] is 999 or less. If it is more than a 1,000, the value returned for doctotal is 1 (instead of 1,000). I've tried parsing the comma and/or the dollar sign and no luck.
SET @serving = CAST(REPLACE(CAST([%N;29] as nvarchar(25)), '$ ', '') as numeric(19,6))
/ CAST(REPLACE([%N;U_EBS_QTYOFSER],'$ ', '') as numeric(19,6))
SELECT @serving
0
Please sign in to leave a comment.
Comments
0 comments