Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I am trying to find the difference between the creation timestamp and the current timestamp, then if the difference is more then 20 days to set that record to inactive.

Timediff :[color:blue]Calc, unstored = Let ([

time = Get ( CurrentTimeStamp ) - Timefirstshark ;

days = Div ( time ; 24 * 60 * 60 );

time = Mod (time; 24 * 60 * 60 )

];

days & ":" & Hour ( time ) & ":" & Minute ( time ) & ":" & Seconds ( time ))

Active:[color:blue] Calc, unstored = Case (Timediff > "20:0:0:0" ; "No" ; "Yes" )

It seems to work at first, but then for some reason it thinks 10:0:0:0 is less then, but 4:0:0:0 is greater?

Posted

There are many approaches. This produces a 0 if it has lapsed and a 1 if not. This is kinda cool (using boolean 1/0) because you can then format your layouts as number (boolean display of [color:green]Lapsed if FALSE 0 and [color:green]Active if TRUE 1).

Let ( lapse = 86400 * 20 ; TimeFirstShark + lapse < Get ( CurrentTimeStamp ) )

The calculation must be Unstored in Storage Options. If you have your heart set on hard-coding in the field, then use Case() or If() like so:

Let ( lapse = 86400 * 20 ; If ( TimeFirstShark + lapse < Get ( CurrentTimeStamp ); "Active" ; "Expired" ) )

I took liberties of wasting an evaluation for clarity because down the road you may wonder what 1,728,000 meant and this clearly indicates 20 exact days. Using 1/0 allows changing what you CALL the result simply by displaying it at the field level. You may want to call it Yes/No in one location, Active/Expired in another and even Current/Lapsed in another. It also easily allows filtering and control of display for portals. :wink2:

LaRetta

This topic is 6564 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.