Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Calculating Date Value

Author  Topic 

hnomani
Starting Member

35 Posts

Posted - 2005-03-24 : 17:25:35
I am new to Reporting Services and trying to do something very basic but not able to figure out how it could be done.

I wanted to display a report based on the YearMonth (YYYYMM) parameter the user enters. However the report should display data between this date and date which is two years in past (Calculated Field). In simple SQL Server terms I wanted to write this function in Reporting Services,

dateadd(month, -23, convert(smalldatetime, @yearmonth + '01'))

How would I write this function and use as a filter in the Report. I know I can add this statement as a parameter in the Data set, but will not that cause the report to execute on the server everytime the user selects a different @yearmonth. Any thoughts or suggestions?

Thanks

eralper
Yak Posting Veteran

66 Posts

Posted - 2005-03-26 : 07:50:38
Hi,

You can use the below sql statement.

SELECT DateAdd(yy, -2, @yearmonth)

Eralper
http://www.kodyaz.com



-------------
Eralper
http://www.kodyaz.com
Go to Top of Page
   

- Advertisement -