Mickdn Posted September 2, 2010 Posted September 2, 2010 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
Lee Smith Posted September 2, 2010 Posted September 2, 2010 Did you try; Get(currentdate) -1 or Get(currentdate)-2
comment Posted September 2, 2010 Posted September 2, 2010 (edited) Try perhaps = Let ( n = Get ( CurrentDate ) - Backup_CreationDate ; Choose ( Min ( n ; 2 ) ; "Today" ; "Yesterday" ; n & " Days Ago" ) ) Edited September 2, 2010 by Guest
LaRetta Posted September 2, 2010 Posted September 2, 2010 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. :^)
Mickdn Posted September 2, 2010 Author Posted September 2, 2010 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
LaRetta Posted September 2, 2010 Posted September 2, 2010 (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 September 2, 2010 by Guest
comment Posted September 2, 2010 Posted September 2, 2010 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?
Mickdn Posted September 2, 2010 Author Posted September 2, 2010 Thanks LaRetta, your calc works perfectly. Things look much nicer now and it seems I was a long way off with my Case calculation.
LaRetta Posted September 2, 2010 Posted September 2, 2010 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:
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now