web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate returns...
Power Automate
Answered

Power Automate returns date in different format from SQL Query

(0) ShareShare
ReportReport
Posted on by 2

Hi,

i´ve been using a power automate flow for some weeks now, which basically runs a SQL query from our database and writes the results on an excel file which then is sent via email.

The main problem is that it returns two date columns, which are stored in the database in yyyy-mm-dd hh:mm:ss format. However, Power Automate writes this column in the excel file as mm-dd-yyyy hh:mm:ss, mixing with previous dates from previously executed flows from weeks ago in the correct format. I want the dates in the same format as they are in the database. This has started happening without notice from one day to another. 

I´ve tried adding to the SQL Query written in Power Automate this line:
DATE_FORMAT("column", %d,%m,%y) AS "whatevername" but it gives a syntax error, BUT if i add this to the query executed through our Database manager, it runs it perfectly fine.

Can someone help me, please?

 

Supercharlie50_1-1657094762294.png

Supercharlie50_3-1657094874411.png

 

First photo shows the date column format in the database, and the second one, how it´s written in the excel file by Power Automate.

 

I have the same question (0)
  • Verified answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    I think it is the problem while pasting the data to excel, i would recommend a macro which can change the column dateformat to required one 

     

    write a macro to change the date format to reqd as below

     

    Sub vba_changedateformat()
    Range("D:D").NumberFormat = "yyyy-mm-dd hh:mm:ss"
    End Sub

     

     

    Execute macro using the execute macro action

     

    Hope this helps u

     

    Thanks & Regards,

    Nived N

  • moocifer Profile Picture
    2 on at

    I wouldn't consider this solved at all.  In fact, it's ridiculous that PAD is incapable of writing date data to Excel without automatically changing to US date format.

     

    Users shouldn't have to write macros, or use Power Query to split columns after converting datetime to text in order to correctly display a date obtained from another source.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 274 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 175

#3
Haque Profile Picture

Haque 166

Last 30 days Overall leaderboard