9 Replies Latest reply on Jul 8, 2011 11:42 AM by GeneWolf

    Date + 2 in header

    GeneWolf

      Title

      Date + 2 in header

      Post

      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?

      Thank you

        • 1. Re: Date + 2 in header
          philmodjunk

          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 )

          • 2. Re: Date + 2 in header
            GeneWolf

            Phil,

            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.

            Gene

            • 3. Re: Date + 2 in header
              philmodjunk

              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.)

              • 4. Re: Date + 2 in header
                GeneWolf

                Thank you... I must have been too quick... I had the day in there.

                • 5. Re: Date + 2 in header
                  GeneWolf

                  I should have tried again before I reposted.  Now I get 7/7/2011.

                  also, where do I specify UNSTORED?

                  • 6. Re: Date + 2 in header
                    philmodjunk

                    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.

                    • 7. Re: Date + 2 in header
                      GeneWolf

                      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 )

                      • 8. Re: Date + 2 in header
                        philmodjunk

                        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 ) )

                        • 9. Re: Date + 2 in header
                          GeneWolf

                          I am soooo sorry Phil, you are correct...

                          I was working on 2010 cases and had my calendar open to 2010 and not 2011...

                          You Rock!