I have existing datatables that include a field of hexadecimal data which is actually a date.
From existing code, I know that data is converted to a DATETIME
values with:
SELECT CAST(0x0000214900000000 AS DATETIME)
My problem now is that I need to insert values into such fields manually, but I don't know how to generate the hexadecimal value for a given DATETIME
.
I have tried to insert AS BINARY(8)
but that does not return the correct value like above.
How do I perform this conversion?