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.
Author |
Topic |
melon.melon
Yak Posting Veteran
76 Posts |
Posted - 2009-08-27 : 22:41:14
|
helloAnybody knows of how to set the report to display default query without selecting any filter and subsequently user filter the report according to filter?Scenerio:Display reports 6 months prior to current date when load and subsequently user select Month & Year filter (in multivalue).Datasource:select *from t1 ainner join t2 b on a.ID = b.IDwhere convert(datetime, '01' + YMth + ' ' + convert(varchar(4), Yr)) > dateadd(month, datediff(month, 0, getdate()) - 6, 0) AND YMth=@YMth AND Yr=@Yr order by a.pNameMonth filter:SELECT DisplayBLMthFROM tbBLMthORDER BY DATEPART(MONTH, CAST('1900-' + DisplayBLMth + '-01' AS DATETIME))Month MthNo: 1,2,3,4,5,6,7,8,9,10,11,12 DisplayBLMth: Jan,......DecYr filterSELECT distinct Yr from t1 where Yr = @YrFor the above, only able to get from Mar 2009 instead.When other month and year filter is selected, it will display Empty. report. |
|
|
|
|
|
|