Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

How to convert Excel datetime value to SQL Server datetime?

Like (0) ShareShare
ReportReport
Posted on 13 Jan 2022 19:57:28 by 173

I've got an Excel spreadsheet with Start and End datetime's.  In Excel they are formatted as "9/21/21 2:39PM".  In my flow I get the Excel table, list the ros from the table, and notice this time comes out as "44460.6110763889".  If I try to use that value in my SQL Server Insert Row step I get an error saying "We cannot convert the value "44460.6110763889" to type DateTime.".  At first I thought it's because of the quotes and I changed the value to a float, but I got the same error.

 

I have figured out how to change this to an integer and use addDays to get the date into SQL Server, however I need the time too.

 

How do I import the Excel datetime into SQL Server?  

 

Thanks!

  • RichardUchytil Profile Picture
    173 on 13 Jan 2022 at 21:04:19
    Re: How to convert Excel datetime value to SQL Server datetime?

    Ah, I missed that!  Thanks tons for the help!!!

  • Verified answer
    CFernandes Profile Picture
    8,283 Most Valuable Professional on 13 Jan 2022 at 20:12:13
    Re: How to convert Excel datetime value to SQL Server datetime?

    Hey Mate,

     

    I assume you are using List rows present in the table if yes just set the format in the action itself-

     

    CFernandes_0-1642104713539.png

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard
Loading started
Loading started
Loading complete