Forum Discussion
Converting Epoch Date fields within the import statement
- 26 days ago
Three points:
1. I'm no expert in SQL but depending on the version of SQL you are using in your database, it may be that division of two integers will result in an integer. If that is the case, you may be able to convert the numerator to a float by multiplying by 1.0
2. Your version of SQL may have builtin epoch converter you can use instead. If it is PostgreSQL look for the to_timestamp() function.
3. In power query M code, you could convert your `Epoch StartDate` to a real date using code similar to below
#"Add Start Date" = Table.AddColumn(#"Previous Step","Actual Start Date", each #datetime(1970,1,1,0,0,0) + #duration(0,0,0,[Epoch StartDate]), type datetime)
Good day, thanks for the assistance. I tried the proposed above using TO_Timestamnp function and got a fail. See below. The last option though requires that I first import the data filed, then convert wihtin Power Query.
Glad to hear that. And yes, the PQ option converts the unix time stamp into a datetime value if you can't do it in SQL