all groups > sql server reporting services > november 2005 >
You're in the

sql server reporting services

group:

Using Parameter Values inside Criteria field


Using Parameter Values inside Criteria field Yorro
11/6/2005 12:10:21 AM
sql server reporting services:
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.

RE: Using Parameter Values inside Criteria field שובל
11/7/2005 3:05:21 AM
try this:
define a parameter inputDays and then use
DATEADD(day, Parameter!inputDays.Value, date_issued)

[quoted text, click to view]
Re: Using Parameter Values inside Criteria field Yorro
11/8/2005 12:21:23 AM
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)


[quoted text, click to view]
Re: Using Parameter Values inside Criteria field Bruce L-C [MVP]
11/8/2005 8:11:34 AM
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]

AddThis Social Bookmark Button