SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Default value for report parameter date field


Default value for report parameter date field

Author
Message
VSSGeorge
VSSGeorge
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2077 Visits: 1578
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())
David Burrows
David Burrows
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16153 Visits: 10103
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.


VSSGeorge
VSSGeorge
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2077 Visits: 1578
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.
David Burrows
David Burrows
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16153 Visits: 10103
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.


VSSGeorge
VSSGeorge
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2077 Visits: 1578
Thank You, David once again. Let me try it out.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search