Wednesday 29 July 2015

SSRS Parameters


I keep searching for the same default values for my date parameters.
Enough! Time for a list!

Yesterday 
=DateAdd("d",-1,Today())
Monday of last week
=DateAdd(DateInterval.Day, 2-WeekDay(Today), DateAdd(DateInterval.Day, -7, Today))
Friday of last week 
=DateAdd(DateInterval.Day, 6-WeekDay(Today), DateAdd(DateInterval.Day, -7, Today))
First day of last month
=dateadd("m",-1,dateserial(year(Today),month(Today),1))
First day of this month
=dateadd("m",0,dateserial(year(Today),month(Today),1))
First day of next month
=dateadd("m",1,dateserial(year(Today),month(Today),1))
Last day of last month
=dateadd("m",0,dateserial(year(Today),month(Today),0))
Last day of this month
=dateadd("m",1,dateserial(year(Today),month(Today),0))
Last day of next month
=dateadd("m",2,dateserial(year(Today),month(Today),0))
One year ago
=DateAdd("yyyy", -1,Today())
First Day of this year
=Today.AddMonths(1-Today.month).AddDays(1-Today.day)
 
 
More to come... 



No comments:

Post a Comment