You can not mix syntax. SQL syntax has to be SQL syntax and expression
syntax (vb.net syntax) has to not have SQL mixed in.
The first way you did it should have worked.
DATEADD(day, @inputDays, date_issued)
I have done this. What error did you get. In layout did you go to the
Report->Parameter Properties (this is from memory, the exact menu might be
different) and change the data type to integer).
When I did it I even did this so the user puts in number of days (not a
negative number).
DATEADD(day, @inputDays * -1, date_issued)
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
[quoted text, click to view] "Yorro" <yuniverse@hotmail.com> wrote in message
news:ObH5a1D5FHA.3188@TK2MSFTNGP15.phx.gbl...
> Thanks for the reply.
>
> Unfortunately, it errors out with a "data type error in expression."
> Performing a CAST to Int still fails: DATEADD(day,
> CAST(Parameter!inputDays.Value AS INT), date_issued)
>
>
>> try this:
>> define a parameter inputDays and then use
>> DATEADD(day, Parameter!inputDays.Value, date_issued)
>>
>> "Yorro" wrote:
>>
>>
>>>Hello,
>>>
>>>In my Criteria column for my dates, I have
>>>"> DATEADD(day, -7, date_issued)"
>>>
>>>Instead of making it fixed to '-7', I want a drop list, or at least a way
>>>for the user to input a number.
>>>
>>>Trying to use a variable like this fails:
>>>"> DATEADD(day, @inputDays, date_issued)"
>>>
>>>By the awy, the DB is MSSQL.
>>>
>>>Thanks!
>>>