May 29, 2006 at 12:33 pm
I need a substitute for de access function eval in sql or reporting server.
I have a string like '10.10+20.20--10'. The resulte is 40.3
thanks in advance
May 30, 2006 at 3:59 pm
I think you can just set the source to:
=10.10+20.20--10
If not, you may need to use the convert function to convert each "string" "number" to a decimal.|
i.e. convert(decimal(5,2), 10.10)+convert(decimal(5,2),20.20)...
I could be way off base or misinterpreting the question.
-Megan
March 9, 2011 at 9:25 am
A easier way using only EXEC :
EXEC('SELECT CAST(
(1.66 * 300 / 1170)
+ (1.75 * 220 / 1170)
+ (1.791 * 0 / 1170)
+ (1.6666 * 100 / 1170)
+ (1.96 * 350 / 1170)
+ (1.8716 * 100 / 1170)
+ (1.6666 * 0 / 1170)
+ (1.44 * 100 / 1170)
AS DECIMAL(18,4))')
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply