Date + 2 in header
I run a report every Tuesday for a Thursday fax to the courts. The date at the top (in the header) needs to be Thursdays date.
Thoughts on the best way to accomplish this?
Define an UNSTORED calculation field as:
Get ( CurrentDate ) + 2
Place this field in the header of your layout.
This assumes you always print on Tuesday.
This expression would return the following Thursday date no matter what day you print it:
Let ( Today = Get ( CurrentDate ) ; Today - dayOfWeek ( Today ) + 5 )
I like the idea of always returning the next Thursday but when I put the formula in, I get 7/5/2011.
The Get current date +2 worked fine.
Make sure you are using the dayOfWeek function, not the day function. (If you were real quick in viewing my response, you may have seen my post using the day function as I posted it initially with Day ( Today ) and then spotted my error, edited and reposted it just a few minutes later.)
Thank you... I must have been too quick... I had the day in there.
I should have tried again before I reposted. Now I get 7/7/2011.
also, where do I specify UNSTORED?
Make sure that this is a calculation field. A date field with an auto-entered calculation will not work here.
If you have defined this as a field of type calculation, find it in Manage | Database Fields and double click it to bring up the specify calculatiosn dialog. In the Specify Calculations dialog, click the Storage Options button and you'll see a "do not store..." option.
I think I have everything set correctly, Still giving me 7/7/2011
I tried to do a screen shot but my stupid firewall keeps kicking it out....
Field name - Next Thursday
Type - calculation
Options/Comments - Unsorted, = Let ( Today = Get ( CurrentDate ) ; Today - DayOfWeek ( today ) + 5 )
And 7/7/2011 is a Thursday no?
The calculation is performing correctly. It's just that if you try this on a Thursday, it'll return today's date as the calculaiton evaluates to:
todays date - 5 + 5.
If you want the following Thursday whenever today is Thursday, modify it to be:
Let ( Today = Get ( CurrentDate ) ; Today - DayOfWeek ( today ) + 5 + 7 * (DayOfWeek ( Today ) = 7 ) )
I am soooo sorry Phil, you are correct...
I was working on 2010 cases and had my calendar open to 2010 and not 2011...
Retrieving data ...