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 Apps / Validating that one da...
Power Apps
Answered

Validating that one date is after the other

(0) ShareShare
ReportReport
Posted on by 121

Hi all,

 

I have two date/time pickers in my app (Start Date/Hour/Minute and End Date/Hour/Minute), following the suggested layout in the solution to this topic

 

I am wanting to implement a validation that the End Date/Hour/Minute entered is after the Start Date/Hour/Minute, and trigger a variable to display an error if not.

 

What would be the best way to approach this?

 

Thanks team!

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,967 Most Valuable Professional on at

    HI @Marty_Dub ,

    Assuming you are using a Date Picker and two drop-downs for each

    If(
     StartDatePicker.SelectedDate +
     Time(
     Value(StartHour.Selected.Value),
     Value(StartMinute.Selected.Value),
     0
     ) > 
     EndDatePicker.SelectedDate +
     Time(
     Value(EndHour.Selected.Value),
     Value(EndMinute.Selected.Value),
     0
     ),
     Notify(
     "End time cannot be before start time",
     NotificationType.Error,
     5000
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Marty_Dub Profile Picture
    121 on at

    Hi @WarrenBelz  -  thanking you - legendary advice and support as always!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard