Skip to content
Advertisement

Use SQL to convert Datetime to w32time

Does anyone know of a way using mirocsoft SQL to convert a date like “2014-10-31 00:00:00.000” to a format of w32time like “130592736000000000”?

Advertisement

Answer

Here you go!

SELECT CONVERT(bigint, DATEDIFF(DAY, '1600-12-31', '2014-10-31'))*24*60*60*10000000

*Edit Fixed now

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement