+ Reply to Thread
Results 1 to 6 of 6

Converting Bianary Type Date from MSSQL to date in Excel

  1. #1
    Registered User
    Join Date
    07-11-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Converting Bianary Type Date from MSSQL to date in Excel

    Hello all,

    Currently I have a spreadsheet exported from a MSSQL database. The date fields are stored in a binary format. An example of one of the values is:
    CAST(0x00009F8F00000000 AS DateTime)

    In MSSQL that converts to:
    2011-11-02 00:00:00.000

    The size of the date is quite large and I don't think running it into MSSQL and back out will work (but I am willing to try)

    I am just wondering if I strip out the CAST AS DateTime and just leave the binary value is there a way to convert these into dates within Excel?

    Basically I need to convert this to a date:
    0x00009F8F00000000

    Any help is greatly appreciated. Thanks.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Converting Bianary Type Date from MSSQL to date in Excel

    Can't you just do double cast in SQL Server?

    SELECT CAST(CAST(0x00009F8F00000000 AS DATETIME) AS DATE)

  3. #3
    Registered User
    Join Date
    07-11-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Converting Bianary Type Date from MSSQL to date in Excel

    Hi JieJenn

    It converts in MSSQL my issue is that I have a couple spreadsheets with this data in cells and they appear in multiple columns. I am hoping to avoid putting the data back into a db and then exporting. Ideally I would be able to do this right in the cell with some sort of function.

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Converting Bianary Type Date from MSSQL to date in Excel

    check your text to column; i think you might have checked separated by semicolon.

  5. #5
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Converting Bianary Type Date from MSSQL to date in Excel

    Or post your excel spreadsheet.

  6. #6
    Registered User
    Join Date
    07-11-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Converting Bianary Type Date from MSSQL to date in Excel

    forum_example.xlsx

    Here is a file with the column in it.

    Thanks again in advance for your time.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1