Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi all,

I'm trying to write a small script that checks if the content of a Date Field has a value that is two days over.

Erm example

Three records... and today's date is 12/4/03

12/2/03

12/6/03

12/4/03

I would want my script's If statement to accept 12/2/03. I hope that make sense, because I'm feeling quite funky today.

Cheers,

Steve Griff

Hi Steve,

Here is the solution,

Go to record [First]

Loop

If[Today-2 = Date]

set field["result", "Date"]

End if

Go to record [Exit after last, Next]

End Loop

Regards,

Henry

You can also just have an extra calculation field that would do the same thing and would be fast and searchable.

cIsDue Number field): MyDate + 2 = status(currentDate)

will return true, a '1' when the date is too days old.

Charles

Don't use the TODAY function Henry!

Oh, ya, thanks for advice. Status(currentdate) is the right function to get the date. grin.gif

Regards,

Henry

Hi:

I suggest using a find script. That way the loop doesn't have to initially loop through all the records in the db which could take a while.

Rather than explain the whole thing, I whipped up this file in a couple of minutes to give an example.

It is a real simple file. Once you do the find script, your script can then do the loop stuff since the found set will be smaller than the total, and the loop won't take so much time.

Ken

PS!! I misread your post. Sorry. My script is greater than or equal to today - 2. But you said just two days ago. Just change the "<=" to "=" in the script and it should be fine.

Find Example.zip

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.