Default value for report parameter date field

  • Hi,

    My SSRS report parameter date field requires “next Monday” as default Start date and “Sunday of the next week” as default End Date. Can it be accomplished using SSRS expression similar to this?

    DateAdd("d",40,Today())

  • This will give you the date of the next monday (note if today is monday then today is the date returned)

    =DateAdd(DateInterval.Day,7-Weekday(Today,FirstDayOfWeek.Tuesday),Today)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Thanks David, for sharing that insight.

    I have put the end date default date as:

    =DateAdd(DateInterval.Day,14-Weekday(Today,FirstDayOfWeek.Monday),Today).

    I hope it is correct.

  • For your end date I think it should be

    =DateAdd(DateInterval.Day,6,DateAdd(DateInterval.Day,7-Weekday(Today,FirstDayOfWeek.Tuesday),Today))

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Thank You, David once again. Let me try it out.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply