Use DATEPART : (DATEPART(HOUR, GETDATE()) * 3600) + (DATEPART(MINUTE, GETDATE()) * 60) + (DATEPART(SECOND, GETDATE()))