views:

286

answers:

2

I have naught but a static XML file to provide me the following data:

Event

Start Date

End Date

I must display a subset of this data within a 120 Day range of the input Parameter (Usually defaulted to today() but, not always).

How can I code paramters for a date range? It looks so simple but, I have spent all day on it.

A: 

Make a Multivalued (drop down list) parameter with something like this

  • Current
  • Last Week
  • Last Month
  • Last Quarter
  • Custom

(or what ever other phrases make sense to you)

And add a textbox parameter for the "custom" option if needed

In you query, resolve the value returned from the drop down parameter in your where clauses as a series of logical evaluations

TFD
This is a good range possibility. I was looking for something even simpler which is causing the headache. When the user enters the date parameter, I simply want the range to extend to the parameter PLUS(+) 120 days.
James Polhemus
@James Polhemus: Yes. So what is the problem with that?If they choose last month, you calculate last month from current date and last month - 120 day in you Where clause. How could this be any simpler for the user?
TFD
A: 

make a StartDate parameter make it time/date datatype and set the default value to:

=CDate(Day(Now()).ToString() & "." & Month(Now).ToString() & "." & Year(Now).ToString())

make a EndDate parameter make it time/date datatype and set the default value to:

=DateAdd("d",120,Parameters!StartDate.Value)

add a where statment in the query and use "between @StartDate and @EndDate" to use the date range .

if you want the EndDate always to be 120 days later then the StartDate use the hide or internal option in EndDate paranmeter

Knut Ivar