• drew.allen - Wednesday, August 9, 2017 7:54 AM

    ravikaliappan - Wednesday, August 9, 2017 3:47 AM

    I tried this it doesn't work

    SELECT CONVERT(datetime, 0x17041D49FCC2D488)
    SELECT CONVERT(datetime2, 0x17041D49FCC2D488)

    First, you should start your own thread instead of reopening an old thread.  This one is three years old.

    Second, saying that something doesn't work isn't helpful.  Does fail?  If so, what is the error message?  Does it produce results, but the results are incorrect?  How exactly doesn't it work?

    Finally, you need to give expected results.  It also might help if you indicated where the binary data is coming from.

    Drew

    He has a thread in here: https://www.sqlservercentral.com/Forums/1890993/RE-How-to-convert-varbinary-to-date
    Not much information, though.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2