cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Help with Date

Hi Powerapp Gurus

 

Need some assistance with date....

I have 2 fields from a sharepoint list;

When did this accident occur?

When was this accident discovered?

 

I am wanting to put a formula where the accident discovered cannot be before the date entered in accident occur.

Thanks in advance

Rae

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @RubesandBoogs ,

Put on the OnChange of Accident Discovered date picker (change to your control names) - this also allows for a blank occur date.

If(
  AccidentDiscoveredControl.SelectedDate < AccidentOccurredControl.SelectedDate ||
  Value(AccidentOccurredControl.SelectedDate)=0,
  Notify(Cannot be before occurrence date, Error);
  Reset(YourAccidentDiscoveredControl)
)

 

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.

View solution in original post

7 REPLIES 7
Super User III
Super User III

Hi @RubesandBoogs ,

Put on the OnChange of Accident Discovered date picker (change to your control names) - this also allows for a blank occur date.

If(
  AccidentDiscoveredControl.SelectedDate < AccidentOccurredControl.SelectedDate ||
  Value(AccidentOccurredControl.SelectedDate)=0,
  Notify(Cannot be before occurrence date, Error);
  Reset(YourAccidentDiscoveredControl)
)

 

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.

View solution in original post

Super User III
Super User III

Assuming you are using AfterDatePicker and BeforeDatePicker, on your submit or Patch button put:

 

If(BeforeDatePicker.SelectedDate>AfterDatePicker.SelectedDate, Notify ("Check the date entered, Before Date, cannot be greater than After Date"), SubmitForm (YourFormName))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

Awesome, thanks @WarrenBelz 

No problem @RubesandBoogs ,

Was my post the solution?

Yes, thank you

@RubesandBoogs ,

That was not the one you accepted - please consider correcting this for the benefit of others viewing in the future.

Sorry @WarrenBelz , first time user of the support function, now corrected

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (21,952)