Jump to content

Show Today and yesterday in calculated date field


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

Recommended Posts

I have a date field that is set by record created date, whenever I create a new record in this table it enters the current date.

This is a phone log field so there are literally hundreds of thousands of records.

I'm trying to create a calculation that displays the today, if the record created date is current date, and yesterday if it was yesterday and all other should be the date itself but when I create this calculation, it doesn't seem to update on a daily basis and just shows today even if the date was yesterday, unless I create a new record.

Any ideas on what I'm doing wrong here?

Link to comment
Share on other sites

14 minutes ago, wattmhite said:

it doesn't seem to update on a daily basis

Is it an unstored calculation field?

--
P.S. Your title says "calculated date field". IIUC, you want the field to display the text "Today" or "Yesterday" under some circumstances. If so, this needs to be a calculation field with the result type set to Text.

Link to comment
Share on other sites

  • 1 month later...

case(

datefield = get(currentdate);"Today";
datefield = get(currentdate)-1;"Yesterday";
datefield

)

 

Must be an unstored calculation and type = text as noted above.

Edited by Cable
Link to comment
Share on other sites

10 minutes ago, Matthew R White said:

Cable, thank you!!! That worked perfectly!!

I have a super trick/hard question to go with this: Is there any way possible, to make sure this calculation field displays the date field in xx/xx/xx format? IE not the 4 digit year? 

Are you trying to create Y2K all over again????? lol

Substitute ( datefield; year(datefield); Right ( year(datefield); 2))

Link to comment
Share on other sites

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