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.

Status(CurrentDate) on stored calculation field

Featured Replies

The formula of my indexed calculation field contain a Status(CurrentDate) function.

The field must be indexed and I don't want to use the Today() function.

When a new record is created the field is calculated correctly.

It is recalculated when any of the referenced field is modified (even if they don't influence the result).

[it is also possible to recalculate it when ANY field gets modified, with a non-influent reference to a time field with modification time auto enter option on]

Are there any other conditions that make the field recalculate?

How do you deal with indexed calculations that depend on the current date ?

Thanks, Paolo.

There are any number of ways to force a calculation to update - via triggers and scripts etc, and from the sound of it, you've already explored some of them.

Rather than having forum users attempt to indicate an exhaustive list of options, however, it might be more to the point if you were to outline what circumstances you want the calculation to update in which you are not presently achieving. It might also be helpful to know why it is that you're reluctant to use the Today function - in order to understand what it is you are trying to avoid, as well.

That way the bandwidth can be targetted at actually helping you *solve* your problem! smirk.gif

  • Author

CobaltSky said:

That way the bandwidth can be targetted at actually helping you *solve* your problem! smirk.gif

Ray, I wasn't detailed on my question because I don't have a real problem to solve.

I'm trying to learn more about the Current Date topic to discover better ways to deal with it (better than the one I'm currently using).

I dont want to use the Today function because (correct me if I'm wrong) it is recalculated only when the database is opened. So the database have to be closed and reopened every day. If the database is hosted with FM Server it have to be closed, opened with FMPro, closed and reopened with FMServer.

My calculations with dates are, most of the time, very easy: just checking if a given date has expired.

For example:

ExpiryDate (date field)

IsExpired (calculation field) = Status(CurrentDate)>ExpiryDate

With a relationship between a constant 0 and IsExpired I can easily display non-expired records on a portal.

This is my most frequent scenario.

Thank you!

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.