default report paramaters - beg and end of month
I have a report with beginning and end dates (2) as paramaters. How do I set the default paramaters of the report to be the first day of the month for the first paramater and the last day of the current month for the second paramater? KDW
November 11th, 2010 3:38pm

check this http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/48c4a948-a63f-40fb-9f8e-f9d3b3c226e5 Gaurav Gupta http://sqlservermsbiblog.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
November 11th, 2010 3:46pm

I have a report with beginning and end dates (2) as paramaters. How do I set the default paramaters of the report to be the first day of the month for the first paramater and the last day of the current month for the second paramater? KDW Hi sierra_gld, From your information I get your requirement completely, you have two parameters BeginDate/EndDate, BeginDate has a default value to first day of Current month, EndDate has a default value to Last day of Current month. If I misunderstand your meaning, please feel free to let me know. Firstly, you need to create two Date/Time parameters BeginDate/EndDate, set BeginDate’s default value utilizing this expression: =CDate((Cstr(Year(Now()))+"-"+CStr(Month(Now()))+"-1")) Then set EndDate’s default value utilizing this expression: =CDate(DateAdd("d",-1,(Cstr(Year(Now()))+"-"+CStr(Month(Now())+1)+"-1"))) If you have any question about the steps, please feel free to ask. Thanks, Challen Fu
November 12th, 2010 4:40am

Hi siera_gld, as Challen already said, you have to use 2 DateTime Parameters. But i discourage form using the EndDate default of Challen as the Monthpart CST(Month(Now())+1) will result in 13 for december, which will result in an Error. Therefore i suggest using: BeginDate: =Today.AddDays(1-Today.Day) EndDate: Either: =CDATE(Parameters!BeginDate.Value).AddMonths(1).AddDays(-1) or: =New System.DateTime(Today.Year,Today.Month,System.DateTime.DaysInMonth(Today.Year,Today.Month)) These are the ways i them. Hope to help
Free Windows Admin Tool Kit Click here and download it now
November 12th, 2010 4:57am

Hi Paul.W. I am sorry for not considering the special situation, thanks for your correct reply. Every day is a school day :) I think sierra_gld will get the right solution after reading the reply. Thanks, Challen Fu
November 12th, 2010 5:32am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics