Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to do formaula calculation inside a string in SQL Server Expand / Collapse
Author
Message
Posted Thursday, February 14, 2013 2:58 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 14, 2013 5:26 AM
Points: 1, Visits: 5
HI,

I need to evaluate a formula in sql server (eg)
((a+b)*c)/d, where this formula will be stored inside a string value like

DECLARE @strFormula VARCHAR(250)
SET @strFormula = ((a+b)*c)/d

And now a, b, c and d all will have some values like 15.25, 20, 22.50, 25 respectively.

pls help me with how to evaluate this

@mnyFinalOutput = the result of the executed formula (i.e) @strFormula with a,b,c,d values replaced.
Post #1419905
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse