KBA-01433: Providing Defaults for Dates in Report Parameters

Question:

How can I make my report date range default to last month?
How can I make my custom report dates act like a date range in Spitfire?

Answer:

First, you can base your dates on TODAY()

  • First day of prior month: =TODAY().AddDays((TODAY().Day  * -1) + 1 ).AddMonths(-1)
  • Last day of prior month: =TODAY().AddDays((TODAY().Day  * -1)  )
  • First day of this month: =TODAY().AddDays((TODAY().Day  * -1) + 1 )
  • Monday before last Monday: =Today().AddDays( ( TODAY().DayOfWeek  + 13)* -1 )
  • Last Friday: =Today().AddDays( ( TODAY().DayOfWeek  + 2)* -1 )

Second, Spitfire treats a pair of consecutive date report parameters as a date range if their names are pFXXX and pTXXX.  So, name your starting date pFMyRange and your ending date pTMyRange and Spitfire will prompt using a date range.

Additional Comments:

There are many more relative date calculations possible.  For example,Today().AddDays( Today.DayofWeek * -1)
returns the prior Sunday‘s date.


KBA-01433; Last updated: October 12, 2016 at 11:21 am;
Keywords:  Default date range, report dates