Skip 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.

get(currentdate) returns wrong date

Featured Replies

Hi,

I have a bank header table and a transaction table. I need to be able to display transaction records in date ranges in tabbed portals. One tab would show transactions up to and including today, the other tab would show future transactions.

I created a global calculation field on the header table using get(currentdate), and used it in the relationship. It semed to be working OK, but then I noticed that the portal was displaying records in the wrong date range. So I displayed the calculated get(currentdate) field on a layout and saw that the problem is the value in the calculation field is wrong - its showing a date of several days ago.

On his website, Dwayne Wright http://dwaynewright.blogspot.com/2007/11/filemaker-storage-of-calculations-using.html

says that B)

"if not set correctly, the current date used in the calculation isn’t the current date but the stored value when it was last refreshed in the calculation."

He suggests using an unstored calculation, but I can't do that with a global field.

So, how do I get a global calculation field to continuously show the correct current date? Or do I just not use a global field?

thanks

Global calculations are stored, and do not refresh unless a referenced field is modified (same like any other stored calculation). Use an unstored calculation field instead.

you need to use an unstored calc. The global calc will not recalc like this. If you MUST use a global field, then you can just set a global field with the current date as part of the startup script.

  • Author

I don't HAVE to use a global field, it just seems like the logical and cleaner thing to do. Why store the current date on every record when one global would (..should) do?

So I guess I have to refresh the global with scripting, or else just use a regular calculation field. Is it just me or does that seems clunky?

Why store the current date on every record

An unstored calculation is ... well, not stored.

  • Author

B)

Thanks Comment ! Silly me !

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.