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 5254 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

What am I doing wrong? I've tried lots of combinations, except the right one.

Case (Get ( CurrentDate ) - Backup_CreationDate & " Day Ago" ;

Get ( CurrentDate ) - Backup_CreationDate & " Days Ago")

I would like this to display

1 Day Ago or 2 Days Ago not "1 Days Ago" it looks horrid.

Thanks

Posted (edited)

Try perhaps =


Let ( 

n = Get ( CurrentDate ) - Backup_CreationDate 

;

Choose ( Min ( n ; 2 ) ; "Today" ; "Yesterday" ; n & " Days Ago" )

)

Edited by Guest
Posted

If you want to truly stick with your wording, Mickdn, it would be:

Let ( diff = Get ( CurrentDate ) - Backup_CreationDate ;

diff & " day" & Case ( diff > 1 ; "s" ) & " ago."

)

Hi Michael, did you forget a -1? I like yours better and mine doesn't account for today properly either, displaying 0 day ago. :wink2:

Mine should be adjusted to:

Let ( diff = Get ( CurrentDate ) - Backup_CreationDate - 1 ;

Case ( not diff ; "Today" ;

diff & " day" & Case ( diff > 1 ; "s" ) & " ago."

) )

Yep, yours is much nicer. :^)

Posted

Hi Lee, not to sure what you mean, but tried your suggestion and all I get is "-1 Days Ago" or "-2 Days Ago".

Thanks

Posted (edited)

This calculation must also be set to 'do not store' in Storage Options or it will not update and be sure calculation result is text.

So best calc is Comment's:

Let (

n = Get ( CurrentDate ) - Backup_CreationDate

;

Choose ( Min ( n ; 2 ) [color:red]- 1 ; "Today" ; "Yesterday" ; n & " Days Ago" )

)

Edited by Guest
Posted

Thanks LaRetta, your calc works perfectly. Things look much nicer now and it seems I was a long way off with my Case calculation.

Posted

Hi Michael, :blush2:

I had used a file with field Today (where I plug in a date) but I simply copy/pasted your calc, which of course used Get ( CurrentDate ). Then I typed 8/31 into today (which was the current day I thought, which was also wrong). It produced incorrect and I was thinking you didn't account that Choose() starts at zero. Too tired; my mistake; sloppy behavior; my apology. :wink2:

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