Hi,
I have written a user defined function to convert a date from an OLD time zone to NEW time Zone. The three parameters are (date, OLDTz,NEWTZ).

=====================================
declare
@v_tz varchar(10) ,
@v_da integer,
@v_ss varchar(100)
select @v_da=7
select @v_tz='GMT'
select @v_ss='soumilpatel'
select substring('soumilpatel',2,3)
select substring(@v_ss,2,3)
select getdate(), dateadd(day, 7, getdate()), dateadd(day, @v_da, getdate())
select top 2 timestampwhenset, dbo.tc(timestampwhenset,'GMT','PST') from s_monitorevents
select top 2 timestampwhenset, dbo.tc(timestampwhenset,'GMT', @v_tz ) from s_monitorevents
go
=====================================

In real life the value of @v_tz is coming from a table. How do I go about resolving the value of the variable before I run the function. I was able to use the variable substitution successfully in a numeric function as well as in a string/character function.

Your input is very much appreciated.
-soumil