Offsetting the time zone in MS SQL 2005

Posted by & filed under Development.

I needed to offset the current time in MS SQL 2005 for a quick fix. I wanted to make sure the solution would not have to be maintained when daylight savings time changed. Taking the difference between the GETUTCDATE() and GETDATE() functions will generate the server’s current time zone offset from UTC time. DECLARE @timezoneOffset… Read more »

Optional Parameter Techniques in MS SQL Server

Posted by & filed under Web Development.

I ran into some nasty SQL today while updating a report at work.  The report accepted several parameters that were optional.  When a parameters value was set to ‘ALL’ then the filter was ignored.   To handle the optional parameters the previous developer had created a set of WHERE statements for each scenario that the parameters… Read more »