How can I convert the time part of a given DATETIME to the number of milliseconds since midnight? For instance,
'2011-08-29 00:00:00' -> 0
'2011-08-28 00:00:00' -> 0
'2011-08-29 01:00:00' -> 3600000
Is there any simple way to do this in SQL Server 2005?
1 Answer