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.

Trying to Find Records more than 12 months old?

Featured Replies

I'm trying to write a script that will find all records in my database which are more than 12 months old. Not necessarily just this year -1, but more like today - 365. My date fields exist as mm/dd/yyyy (all in one field). What's the best way to go about this? Thanks.

Go to layout (with date field on it)

Enter Find mode ()

Insert Calculated Result(yourDate, "<" & TextToDate (Status (CurrentDate) - 365) )

Perform Find ()

  • Author

I'm getting no joy when I try to enter that formula. I keep getting a "too many separators in that function" message and the highlight is on the last 2 digits in the year. What am I doing wrong? Thanks.

I don't see a specific date anywhere in Fitch's calc. Are you entering an actual date, or the date field?

  • Author

I've tried it both way and neither works.

Todd

Tom's formula is B)

"<" & TextToDate (Status (CurrentDate) - 365)

make sure you didn't entered

"<" & TextToDate (Status (CurrentDate) - 365))

FM error capture is not that good to locate the bad string.

Ok, ok. I think I know...

Use DateToText instead of TextToDate

That won't fix your too many separators error, but you will need it.

Ken

  • Author

For the life of me, I can't get that formula to work- here's what I have so far - please let me know where I've gone wrong, since I've never used the Calculated Result step before:

Go To Layout (date field)

Find All

Go To Field (Date)

Enter Find Mode (Pause)

(User enters date)

Insert Calculated Result: "<" & DateToText(Status(CurrentDate) - 365)

Perform Find

All I keep getting is a "No Records Match This Request" error - but they are definitely present.

Help!

Thanks,

Todd

User enters date and then you overwrite their selection based on today's date?

  • Author

I think I get it - I don't have them enter anything in the date box, right? Just use the calculation.

Actually, if you're not using the 'Select' option with your Insert Calculated Result, then you're find criteria is "entereddate < today - 365", which isn't a result; it's a conditional test! It doesn't appear that you even need a user-entered date. But if you do, not using Select forces the inserted calc to be appended to the field's current contents, instead of replacing them.

Furthermore, it would appear you are using a less than "<", yet you want to search for records greater than, ">", one year.

  • Author

It works! Thanks. (works with the "<", not the ">")

Todd

Well it took like 4 of us to figure it out, but we finally got it!

Well, that was fun. Sorry about the "TextToDate" -- my fingers got ahead of my brain. As for "<" -- even though we may phrase it in English "greater than a year old," what that means in logical terms is a date "less than" the date a year ago.

PS: even though you specified "today - 365" in your original question, I think you'd get a more accurate result if you did use a "year - 1" construct:

Insert Calculated Result: "<" &

DateToText( Date (

Month(Status(CurrentDate) ),

Day(Status(CurrentDate) ),

Year(Status(CurrentDate) - 1) ) )

Yeah, nevermind me. It's been a long week. This proves that I should be sleeping instead of eagerly programming.

I think we should all hit the showers and try for another W tomorrow. cool.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.