• It is also nice when you want to look at all the values relative to your current timezone. For instance, all the logging data goes into the table from the various servers in their timezone. Well, I have trouble thinking about what time 14:00:00 +7:00 is, but I can just do SWITCHOFFSET(-6*60,<datetimefield>) and have it in my time zone.

    SWITCHOFFSET is a very nice function when it comes to DATETIMEOFFSET and I wish we'd had it and DATETIMEOFFSET as far back as SQL 6. The oddball things I have to do to work with datetime data and handle things like Daylight savings time, and timezone variations magically go away for me with DATETIMEOFFSET.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]