Newbies Gil Posted June 18, 2004 Newbies Share Posted June 18, 2004 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 More sharing options...
dbruggmann Posted June 18, 2004 Share Posted June 18, 2004 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 More sharing options...
Newbies Gil Posted June 18, 2004 Author Newbies Share Posted June 18, 2004 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 More sharing options...
Reed Posted June 18, 2004 Share Posted June 18, 2004 You can change the date setting on your computer to test this today Link to comment Share on other sites More sharing options...
n1k0 Posted July 4, 2004 Share Posted July 4, 2004 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 More sharing options...
Robert Kidd Posted July 4, 2004 Share Posted July 4, 2004 Try turning it around, use your globals on the left side of you relationship.Sample file enclosed. DateRangePortal.zip Link to comment Share on other sites More sharing options...
n1k0 Posted July 4, 2004 Share Posted July 4, 2004 It appears to work! G_CurrentDate was stored, but unlike my attempt, yours still worked when I unstored it. Thanks for the unexpected answer! Much gratitude, n Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now