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 |
|
eewald
Starting Member
2 Posts |
Posted - 2005-01-26 : 10:57:09
|
| I'm a definite newbie with SQL. I'm trying to construct a query in SQL Reporting Services.I need to collect rows that lie between a certain daterange. I'd like to have the range be set with a paramter.I think this is the relavant piece of code.Criteria : TRANSACTIONDATE < STARTDATE + 180 This worksI try to put in a parameter TRANSACTIONDATE < STARTDATE + @DATERANGEand then enter in 180 when prompted but then I get this errorApplication uses a value of the wrong type for the current operationThanks in advance! |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-01-26 : 11:34:49
|
look up DateAdd function in SQL Help = Books Online = BOLif 180 is number of days:dim @DATERANGE intset @DATERANGE = 180select *from MyTablewhere TRANSACTIONDATE < dateadd(d, @DATERANGE, STARTDATE) Go with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|