i want to covert binary datatype to datetime using stored procedure and parameters
i create the following stored procedure but it dosen't return correct value
create proc Binary_to_DateTime
(
@mydate_bin binary
)
as begin
SELECT CAST(@mydate_bin AS DATETIME)
end
when execute this proc using this binnary value (0x0000000000000000000000000000000000000000000000008C3000000000)
exec Binary_to_DateTime 0x0000000000000000000000000000000000000000000000008C3000000000
it returns 1900-01-01 00:00:00.000
which is not correct
the correct value is 1998-04-05 00:00:00.000
How to make it return the correct value?
Thanks