September 2, 201015 yr 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
September 2, 201015 yr Try perhaps = Let ( n = Get ( CurrentDate ) - Backup_CreationDate ; Choose ( Min ( n ; 2 ) ; "Today" ; "Yesterday" ; n & " Days Ago" ) ) Edited September 2, 201015 yr by Guest
September 2, 201015 yr 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. 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. :^)
September 2, 201015 yr Author 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
September 2, 201015 yr 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 September 2, 201015 yr by Guest
September 2, 201015 yr Hi Michael, did you forget a -1? I don't think so... Why do you feel it's required? Isn't "0 days ago" today?
September 2, 201015 yr Author Thanks LaRetta, your calc works perfectly. Things look much nicer now and it seems I was a long way off with my Case calculation.
September 2, 201015 yr Hi Michael, 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:
Create an account or sign in to comment