Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How do I compare dates?

Avatar

Level 4

Hello!

I have 2 field. The first there is current date and second there is date fill by user.

I want to compare the two dates and I want that return how many days of different. Is it possible?

Example:

06/15/2010 compared with 06/20/2010 result = 5 days

Thanks!

3 Replies

Avatar

Level 9

Hello Rafael ,

You have to use Date2Num functions Here . Suppose you have two Date fields as Date1 , Date2 , You have a text field where you have to show the difference of the days . You may a need a button where you can put the following scripts .

TextField1..rawValue =((Date2Num(Date1.rawValue, "YYYY-MM-DD")) - (Date2Num(Date2.rawValue, "YYYY-MM-DD")))

You have to put the script in the click event of the button using the FormCalc .

Hope it helps .

Thanks .

Bibhu.