SELECT CONVERT(INT, CONVERT(DATETIME,'2013-08-05 09:23:30')) or SELECT CONVERT(INT, CAST ('2013-08-05 09:23:30' as DATETIME))