cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mrunal
Level: Powered On

Compare date

How to get current year from predefined function or from textfield containing date . Also how to compare the date with current year? Please suggest some help.

1 ACCEPTED SOLUTION

Accepted Solutions
Bassel
Level: Powered On

Re: Compare date

Hello , 

I managed to compare two dates and show and hide a field if the time differenence is more than a year like this :

If(
DateAdd(
TargetItem.LastReview,
365,
Days
) < Now(),
UpdateContext({UpdateBTNgroup: true}),
UpdateContext({UpdateBTNgroup: false})
);

View solution in original post

6 REPLIES 6

Re: Compare date

Hi,

 

you may find what you need here :

https://powerapps.microsoft.com/en-us/tutorials/function-date-time/

https://powerapps.microsoft.com/en-us/tutorials/show-text-dates-times/

 

the function DateDiff can be used to compare 2 dates

 

 

Matthieu Megaly
Steelman70
Level 10

Re: Compare date

Hi, in addtition to what MatthieuMegaly suggested you can use the string functions Left, Mid, Right.

Example here https://powerusers.microsoft.com/t5/PowerApps-Forum/Using-numbers-and-dates-from-SharePoint-lists/m-...

hngdev
Level 8

Re: Compare date

Hello,

 

To get current date, you can you Now function

To compare date:

- I think you should convert the date text type from textfield (I assume) to date type by using Date function

- Then, use DateDiff function to compare 2 dates.

You can go here (Formular Reference) for more information.

naredie87
Level: Powered On

Re: Compare date

You can use for example:

 

Text( yourDateVariable, "mm/dd/yyyy" ) = Text( Today(), "mm/dd/yyyy" )

Bassel
Level: Powered On

Re: Compare date

Hello , 

I managed to compare two dates and show and hide a field if the time differenence is more than a year like this :

If(
DateAdd(
TargetItem.LastReview,
365,
Days
) < Now(),
UpdateContext({UpdateBTNgroup: true}),
UpdateContext({UpdateBTNgroup: false})
);

View solution in original post

Administrator
Administrator

Re: Compare date

Thank you for the useful tip @Bassel

 

@TopShelf-MSFT

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 76 members 3,790 guests
Please welcome our newest community members: