Pravin Ghadge

Pravin Ghadge

  • 566
  • 2.1k
  • 586.6k

How to link formula to particular variable in SQL Querry

Jul 28 2011 4:06 AM
Hi friends,

I have created 1 Formula Master. In which i have created list of formulas

For Eg: 
B 60/60 (Hob Cabinet)=Height*Depth

I have used foll querry to calculate calculation.

declare @Depth as numeric(18,2)
declare @Height as numeric(18,2)
declare @Area as numeric(18,2)

declare @Formula as varchar(100)


set @Depth=100
set @Height=100

Set @Formula=(Select Formula from [formula_master] where [name] = ('B 60/60 (Hob Cabinet)'))

select @Formula

if(@formula=(Select Formula from [@formula_master] where [name] = ('B 60/60 (Hob Cabinet)')))
begin

set @LPR=@formula
Select @LPR
end 



Plzzzz help me out.......



Answers (3)