0

I'm using the following expression to pull a default date from yesterday:

=DateAdd("d",-1,Today())

The business requirements changed and now they want to see yesterday AND today. Is it possible to add onto this expression to include yesterday and today?

Byronyk
  • 29
  • 2
  • 8
  • 1
    Why not give yourself some flexibility and create separate parameters for start and end dates that default to yesterday and today, respectively? Your filter criteria will most likely be a bit cleaner for it. – bitnine Sep 09 '16 at 15:15
  • Is your date parameter setup to allow multiple values? One way to tell if it is would be that it appear as a drop-down instead of a calendar in the UI. – Jesse Potter Sep 09 '16 at 15:19

1 Answers1

0

Just set the parameter to yesterday date and change this in your query.

WHERE [DateColumn] >= @DataParam

If you want to show the dates the report is using, try this in a textbox:

="Dates: " & Parameters!DateParam.Value & "-" Today()

UPDATE: If your parameter is multivalued you have to add two default values using these expression:

=Today()


=Today.AddDays(-1)

Then in your query change this:

WHERE [DateColumn] IN (@DateParam)

Let me know if this helps.

alejandro zuleta
  • 13,962
  • 3
  • 28
  • 48
  • Esh, I should have done that. I'll make that change to the query and give it a test (though it should work). Thanks mate! – Byronyk Sep 09 '16 at 15:40