angelIII,
Thanks for the quick response, but I think you missed the part about needing to use a table full of conversions in it. I apologize if I was unclear.
So the table might look like:
ref_conversion_units
------------------------
StartUnit varchar(20), EndUnit varchar(20), Formula varchar(50)
'deg C', 'deg F', '(x * 1.8) + 32'
'deg F', 'deg C', '(x - 32) * 5/9'
Now how can I use that table inside of that same UDF? From what I've been doing, it's not as simple as just doing a REPLACE(Formula, 'x', ValueToConvert). It would be that easy if I could just run the sp_executesql or EXEC, but UDF's don't allow it.
Thanks.
Main Topics
Browse All Topics





by: angelIIIPosted on 2007-02-05 at 06:16:11ID: 18467823
create function dbo.CtoF ( @c numeric(20,5) )
return numeric(20,5)
as
begin
return (( @c *1.8 ) + 32 )
end
select dbo.CtoF ( 10 )