Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Converting literal date values to Date Format

I have a new project that is pulling in data from a proprietary SQL database.  I am using a query to get the data and it comes through fine, however the date data is showing up as long integers like 1412956095860.  I tried to use the DATE() or DATEVALUE() to convert it to mm/dd/yyyy hh:ss, but it is not working.  When I save the results as a csv and then open in Excel, it seems to convert automatically.  What should I do to solve this?  Or should I just have a SQL script that produces a csv and then read the data from there into Power BI?

 

Thanks,

 

Brad

 

 

 
 

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    When you say proprietary SQL database do you mean not Microsoft or Oracle or IBM but something you wrote or some other vendor?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Something written from a vendor; proprietary might not be the correct wording, but it is a database I am not going to change.  It is a local instance, but is intertwined with SaaS we use.  And I am thinking that all this number is is probably the number of seconds from 1-1-1900 (or whatever it is) so I need to divide that number by 86400 and format on that result?  These numbers I think are like the Excel Date serial numbers and might be an easy way for the program to do Date Differences quickly.