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.

Finding Records 30 days old?

Featured Replies

  • Newbies

Hi All,

Been mulling this one over for a while and can;t find the simple solution. I have a "Date Created" for all records in the database. I'd like to create a button on my site where people can just click and see the latest 30 records?

So I'd do something like:

<input type="hidden" name="-op" value="gte"

<input type="text" name="Date Created" value="???">

How can I create a value for a date 30 days ago?? I do not want to call a script from the web. Is the answer going to be a simple javascript to create the value? Or is there an easy method?

Thanks

Jake

You could have a Calculation field which calculates the age of the record in days. Then test against that field. Or, use some Javascript to calculate the target date.

All the best.

Garry

I think

<input type="hidden" name="-op" value="gte"

<input type="hidden" name="Date Created" value="[FMP-currentdate]">

<input type="submit" name="-find" value="Find last month">

should do

Hi, Jake! Actually, I had done exactly what garry described and it works great. I created calculation fields (unstored) called thisday, tomorrow, in7days, and in30days and just perform searches based on those. Here's some of my code...

<INPUT TYPE="hidden" NAME="-op" VALUE="gte">

<INPUT TYPE="hidden" NAME="fieldname" VALUE="[FMP-field:thisday]">

<INPUT TYPE="hidden" NAME="-op" VALUE="lte">

<INPUT TYPE="hidden" NAME="fieldname" VALUE="[FMP-field:in30days]">

This searched inclusively for dates from that same day up to 30 days hence.Of course, I also had sort criteria and stuff but that's the basics. The calcuation fields in FMP are very easy...

thisday=today

in30days=today + 30

Hope this helps! --ST

I may be wrong on this, but instead of using today in your calculation you may be better off using Status(CurretnDate). Last I knew this had to do with restarting FMP (or not) once a day.

Hi, Unable! Thanx for the warning and I do seem to remember something about when to use Status(CurrentDate) vs. today, but today seems to be working OK for me without restarting FMP. Maybe it was version-specific or something and they fixed it... I'll keep an eye on it, though!

Thanx.

--ST

Leave FMP running for a couple of days. Then see if everything's still OK.

Today only recalculates when FMP first starts. After 24 hours the calc resuts will be incorect.

  • 2 weeks later...

Hi, Vaughan/Unable! You were both right about TODAY. I forgot I had been rebooting the server everyday automatically in Mac OS 9. When I moved to X, it was not calculating correctly.

thisday=Status(CurrentDate)

tomorrow=Status(CurrentDate)+1

etc.

These work better. Thanx. [Public FYI: unstored, global]

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.