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 |
Tonic
Starting Member
26 Posts |
Posted - 2006-06-01 : 01:30:56
|
I have a report that runs on a number of parameter date fields (coverted to string). At present, the report automatically defaults to MAX value of a date. The syntax for that particular element/dataset isSELECT CONVERT(char(11), MAX(src_date)) AS src_date_curFROM tbl_src_dateWhat I am looking to acheive is that if I was to modify the parameter to allow the user to specifiy a date from that particular field (rather than default to MAX), how could I get the subsequent parameter boxes to requery automatically. The code I use for the other 5 parameter fields is; SELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur, CONVERT(char(11), dateadd(mm,-1, MAX(src_date))) AS src_date_preFROM tbl_src_dateSELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur, CONVERT(char(11), dateadd(mm,-2, MAX(src_date))) AS src_date_pre2FROM tbl_src_dateSELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur, CONVERT(char(11), dateadd(mm,-3, MAX(src_date))) AS src_date_pre3FROM tbl_src_dateSELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur, CONVERT(char(11), dateadd(mm,-4, MAX(src_date))) AS src_date_pre4FROM tbl_src_dateSELECT CONVERT(char(11), MAX(src_date)) AS src_date_cur, CONVERT(char(11), dateadd(mm,-5, MAX(src_date))) AS src_date_pre5FROM tbl_src_dateIf it makes a difference I am using SS-RS 2005.RegardsToni Caka Talisa |
|
|
|
|
|
|