Forum Discussion
Converting Epoch Date fields within the import statement
- 1 month 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)
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)
Hi on, thanks for the suggestion. It finally worked to give me the hh:mn values. Thanks very much