Grey
Grey

Reputation: 41

SSRS date time parameter

I'm trying to load default values in my report, like below screenshot. From to field is 'Yesterday' and to field is 'Today' or 'Now'

Parameter screenshot

I can't seem to make this to work. I want to load yesterday's date and convert time format to dd-MMM-yyyy

=CDate(DateAdd(DateInterval.Day, -1, Now()).ToString("dd-MMM-yyyy")

This one works fine,

=CDate(Now).ToString("dd-MMM-yyyy")

Any idea?

Upvotes: 0

Views: 73

Answers (1)

Grey
Grey

Reputation: 41

It's simpler than I thought, I got it to work.

=CDate(Now.AddDays(-1)).ToString("dd-MMM-yyyy")

Upvotes: 1

Related Questions