November 19, 2007 at 5:18 am
I need to find the difference between local time and GMT that accounts for both time zone and DST.
I thought that a smart way would be to call the GetDate() and GetUTCDate() functions, but I get
the following error:
Msg 443, Level 16, State 1, Procedure GetUTCtoLocalHourDiff, Line 12
Invalid use of 'getutcdate' within a function.
Does this mean I can't use the function?
Is there a workaround?
Thanks in advance
November 19, 2007 at 5:38 am
Yes, there is a work around...
Create a view that looks like this...
CREATE VIEW dbo.vGetUTC AS
SELECT GetUTCDate() AS UTCDate
Then "call" the view from the function instead of calling GetUTCDate().
--Jeff Moden
Change is inevitable... Change for the better is not.
November 19, 2007 at 9:28 am
Thanks Jeff!
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply