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 / DateTime Value Validat...
Power Apps
Unanswered

DateTime Value Validation Failed to Return Correct Results

(0) ShareShare
ReportReport
Posted on by 473

Issue: I'm unable to get the correct results when comparing DateTime values.

Formula:

 

 Switch(
 LookUp(
 ForAll(
 Filter(
 'Reservation Details',
 (
 // 12pm >= 12pm (condition met)
 ('Start Date Time' >= FromDate_Dp.SelectedDate + Time(Value(FromTimeHour_Ddl.Selected.Value), Value(FromTimeMinutes_Ddl.Selected.Value), 0)

 &&

 // 12pm < 6pm (condition met)
 'Start Date Time' < ToDate_Dp.SelectedDate + Time(Value(ToTimeHour_Ddl.Selected.Value), Value(ToTimeMinutes_Ddl.Selected.Value), 0))
 )
 ),
 {
 DeskName: 'Reserved Desk'.Name,
 BookingStatus: Text('Booking Status')
 }
 ),
 DeskName = ThisItem.Name
 ).BookingStatus,
 "Booked", // (condition met)
 Color.Red, // *** (this result was not achieved)
 Color.Green
 )

 


Value of 'Start Date Time' : 22 Feb 2024 12:00pm

gymcode_6-1708483993798.png

 

Value of 'FromDate_Dp': 22 Feb 2024 12:00:00

gymcode_0-1708494026078.png


Value of 'ToDate_Dp': 22 Feb 2024 18:00:00

gymcode_1-1708494173812.png

 

Question: May I know why despite criteria being met, the above validation failed to return true?

Could it be due to the Time format of the values that caused the validation to fail?

Categories:

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 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard