Jump to content

Get ( CurrentDate ) - don't update


This topic is 7095 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Hello,

The "Get ( CurrentDate )" function I used in a calculation field should force to change the result (the date !) of that field when a certain date is achieved. But it doesn't do that. Is this normal or a malfunction ?

We don't have the old "Today" function ... so I have to use a script to get to. Is this correct ?

Any help would be appreciated! Thanks.

(FMP 7 & MacOS X 10.3.4)

Gil

Link to comment
Share on other sites

If Get(Current System Date) doesn't update, you have probably chosen to store the calculation (or it is forced to be stored, because it is used for a relationship). If you can't unstore the calculation, you could integrate an update mechanism in the start script for your file:

SetField(DateFieldForTrigger; Get (System date))

and use "DateFieldForTrigger" in the calculation instead of Get (System Date).

Link to comment
Share on other sites

  • Newbies

Detlev Bruggmann: You are right ! Here is the situation:

Case (

DayOfWeek ( Get ( CurrentDate ) ) = 1 ; Field1 ;

DayOfWeek ( Get ( CurrentDate ) ) = 2 ; Field2 ; (...)

To make this work properly, everyday, I must to check the option "Do not store calculation result - recalculate when needed" ... I forget that little thing.

I'm going to see tomorrow - when the date changes - if this is confirmed.

Thanks anyway,

Gil

Link to comment
Share on other sites

  • 3 weeks later...

I'm working on a db right now that uses get(currentdate) to calculate "days overdue" (A). With a global field for "days notice before due" (: and a relationship where A<B, I can make a portal showing nearly overdue and overdue events. In other words, B says "show me records in field A less than 5 days pending". This works, but only when (A) is indexed, so the get(currentdate) glitch appears.

Bruggmann's otherwise elegant "SetField(DateFieldForTrigger; Get (currentdate))" solution breaks indexing, and thus the above relationship, since the trigger is a global. The calc I use for the relationship lookup is unstorable, and complains that it "... cannot be stored or indexed because it references a related field, ..., or a field with global storage."

There MUST be some way to do this!

How do you create relationships based on date-sensitive calculations?

Curiouser and curiouser...

n1k0

Link to comment
Share on other sites

This topic is 7095 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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