Expand my Community achievements bar.

Date/Time Field predates another

Avatar

Level 2

Hello,

I have two date/time fields in my form: "Date of Visit" and "Date of Previous Visit". Is there a code or any way to ensure that "Date of Precious Visit" always predates "Date of Visit"??? Or am I asking too much?

Thank you in advance!!!

Maria

2 Replies

Avatar

Level 10

Hi Maria,

Yes, it can be done. You just need to convert the dates into a number and then compare both numbers. If the date of visit (number) is greater than the previous date of visit (number) then you can display an error.

Here is a simple example: https://acrobat.com/#d=7PUFBNqH7BvNJpihaI2JFw It can be extended to clear the data, so that the user has to reselect the dates.

Good luck,

Niall

Avatar

Level 2

Thank you Niall !

It works perfect!