Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Formula Calc From Another Formula

Author  Topic 

Kalaiselvan
Posting Yak Master

112 Posts

Posted - 2013-12-05 : 07:01:26
Got a table with some formula and its Mapped with some other Table. Please help me how to calc the Formula in SQL.

TableA:
[ID] [Varname] [IsFormula] [Formula]
101 Var1 0 101_Vol
102 VAR2 1 102_Vol+101_Vol
103 Var3 1 103_Peso/102_Vol
104 Var4 0 104_Peso

TableB:
[VARID] [ModelName] [IsFormula] [Formula] [MAPID]
1 Volume 1 VAR2+VAR3 102,103
2 Price 0 Var4 104
3 Value 0 Var1 101

How to Calc the formula Using the Above Table. Because Formula is taken from Another Formula.


Regards,
Kalai

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-05 : 13:22:08
So what should be output from above?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -