This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How to convert UTC date to local time in an alert message


What is the SQL syntax to convert a UTC date/time, such as in the datetime field for a unDP (universal device poller)?  I keep getting:

MACRO SQL ERROR - Incorrect syntax near '7'.

for this statement:

Local time:  ${SQL:Select DATEADD(hh,DATEDIFF(hh, GETUTCDATE(), GETDATE()),('''' + ${CustomPollerStatus.DateTime} + ''''))}

unDP Taken (UTC time): 11/19/2013 7:45:30 PM

I realize it doesn't like the blank, and I need quote marks around the date so it treats it as an entire string, but I'm having trouble coming up with the right syntax.