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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Compare Dates

(0) ShareShare
ReportReport
Posted on by

I have a flow where I am comparing dates to see if one is in the future.  The format is MM/dd/yy. 

If %date% is not greater than %currentdate% then ask to re-enter to future date.

I can't get it to work properly.  It never accepts a date as in the future and always asks me to re-enter.  Is it because of the format?

 

Categories:
I have the same question (0)
  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @Etignor1 

    Are you able to share screenshots of your flow?

     

  • Community Power Platform Member Profile Picture
    on at

    Sure.  the first shot shows how I get the current date and format it.  The second shows the If statement.  The %Closingdate% is formatted the same as the current date format exactly.

     

    current date.pngcurr date greater than closing date.png

  • Verified answer
    andersjensenorg Profile Picture
    28 on at

    Hey Etignor1 🙂

     

    That's the wrong approach (you're trying to compare two text representations of DateTimes).

    What you should do instead (see below):
    1. Convert the ClosingDate text variable to DateTime. Remember to add the 00:00:00 AM to the Converting text. I called the output DateTimeClosingDate.
    2. Compare the CurrentDateTime (don't convert it to text) to the DateTime

    I've created the flow for you:
    DateTime.png
    PS. My Set variable (%ClosingDate%, 12/24/2022) was an example.

  • Community Power Platform Member Profile Picture
    on at

    Thanks buddy!!  I appreciate you!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard