Hello,
I have date text in format MM/DD/YYYY as "07/02/2021"
I require to evaluate, if "07/02/2021" is greater than today.
How can I do that, for some reason following formula throws null value for label, therefore I am unable to evaluate - can you help?
Text(DateValue("07/02/2021",DateTimeFormat.ShortDate))
Thanks,
If you know that the date will always be in the "mm/dd/yyyy" format, you can pass the second parameter to the DateValue function that specifies which locale it will be used (for example, "en-US" uses that format). You can then compare that date with Today():
If(
DateValue("07/02/2021", "en-US") > Today(),
"July 2nd is greater than today",
"July 2nd is not greater than today")
You mentioned that the formula that you have is having an error; that is because the second parameter to the DateValue function is the language to use when converting from text to dates. The DateTimeFormat enumeration can be used to as a parameter to the Text function.
You can use:
DateDiff(Now(),DateValue("07/02/2021"))>0
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473