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.

Searching for old Records by Month

Featured Replies

I have a script that runs on the first of every month. What I want the script to do is to find the records that are older than three months. Because not all months end on the 31st, I have no idea how to do the query. I think it should be roughly <= Status (Current date) - 3 months and 1 day. Any ideas on this one? Thanks!

Hi, Chevell. Make a calc field, number, equal to:


Month ( theDateField ) <= Month ( Status ( CurrentDate ) )

Find for the number 1 in there, and you should be good to go.

HTH,

Jerry

Hmm. Jerry's calc will give you all records less than or equal to the current month for all years. This wouldn't work too well in January unless you only wanted all January records in your file. Ask.gif I think what you're looking for is

Enter Find Mode [ ]

Insert Calculated Result [yourdatefield; "<=" & DateToText(Date( Month(Status(CurrentDate)) - 3, Day(Status(CurrentDate)) - 1, Year(Status(CurrentDate)) ))]

Perform Find [ ]

This will be faster than a calc that would have to be unstored in order to update daily. Note that yourdatefield must be on the current layout when the script runs.

  • Author

I *think* i get you but can you explain that code? The first part of the calculation finds the month name of the create date. The second part finds the month name of the current month. But what's the less than or equals do? And how do I find three months back? Thanks again!

  • Author

hmm, ok, that makes more sense. I am going to try this out. If I am using the Current Date status function, will I need to close the database to update the value of that or will it update on its own? Thanks much!

It will update as soon as the script is called. It is only the Today function that requires closing and opening the file to update.

d-oh.gif

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.