I am try to use a redgate product that needs the date in ticks i.e 634925952000000000 = 01/01/2013 00:00:00
Can I find a convertor to work out 01/01/1901 00:00:00 in sql
without this happening “The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart.”
SELECT DATEDIFF(s, '19010101', GETDATE())*1000000
answer no can anyone help.
Just the the value for 01/01/1901 00:00:00 really as app use this as a null date.
The number of seconds returned between those 2 dates is too many for the datediff data type to support which is an int. I’ve seen others use the difference in minutes, then convert to seconds using BigInt instead.
Try something like this:
Here’s the SQL Fiddle.
Good luck.