Excel dates stored in SQL Table in Decimal format - convert back to dates

39 views Asked by At

I have a Power Automate flow that is reading from Excel, and is storing date values in a SQL table.

29/03/2023 is being stored as 45014.75, and 17/10/2023 is being stored as 45216.3958333333.

Does anyone know how these values can be converted back to actual dates? I thought I could do something like the below but it errors out.

SELECT
    convert(datetime,'45014.75', 103),  --29/03/2023 
    convert(datetime,'45216.3958333333', 103) --17/10/2023
1

There are 1 answers

0
Sam Nseir On BEST ANSWER

Set the DateTime Format to ISO 8601, under Advanced Options, in the Excel Power Automate action.

enter image description here