Archive for the 'SQL' Category

Convert an Integer Date to a Smalldatetime

A common way to represent a date - often in mainframe systems - is in the format yyyymmdd. Unfortunately it is not easy to do calculations on such a representation. To be able to use the native T-SQL date functions such as datediff and dateadd you will need to convert it to the datetime or smalldatetime type.

Read more »