all groups > sql server reporting services > august 2005 >
You're in the

sql server reporting services

group:

YTD Parameters


YTD Parameters bugfish69
8/8/2005 12:00:27 PM
sql server reporting services: I need to set a default start paratmeter for a client report where the period
always begins on Aug 1st. The report & delivery via email on the first day
of each month for the period 8/1/?? through the end of the previous month.
Typically, we run reports for the previous month only and my start parameter
is =today.addmonths(-1). I can not seem to get the right syntax to caluclate
a parameter of 8/1 based on is it is this year or last year.

Re: YTD Parameters BrianK
8/8/2005 6:25:00 PM
Try this:
=Today.AddMonths(-1).ToString( "yyyy-MM-01")
if your date param datatype is String

or

=Date.Parse(Today.AddMonths(-1).ToString( "yyyy-MM-01"))
if your date param datatype is DateTime

NOTE: mm <> MM

Brian
www.bolign.com
Re: YTD Parameters bugfish69
8/9/2005 8:09:02 AM
Brian,

Thanks for putting me on the right path. Since my YTD start is always 08/01
I used the following:

=iif(today.month >= 9, Date.Parse(Today.AddDays(-1).ToString(
"yyyy-08-01")),Date.Parse(Today.AddYears(-1).ToString( "yyyy-08-01")))

[quoted text, click to view]
AddThis Social Bookmark Button