SQL Server user defined function to convert MSDB integer data to data time 
(Tim Ford) In a recent tip I outlined a process for converting a date, stored as an integer into a datetime data type. Date and time information for run history of SQL Server Agent jobs is stored within the msdb..sysjobshistory table as an integer data type, not as a datetime as one would expect. Most likely for at least two reasons:
--This structure is a legacy implementation from the earliest days of SQL Server
--The values are stored in separate run_date and run_time columns and until SQL Server 2008 there was not a time data type per se
Read Article >>