vbnetcoder
asked on
IN with variable
I have the following query
Select * From Table
Where AssetType IN(1,2,3)
How would i change it so that there would be a variable for the items being passed in something like this?
DEClare @AssetList as varchar
Select * From Table
Where AssetType IN( @AssetList)
This will be used in a SSRS report
Select * From Table
Where AssetType IN(1,2,3)
How would i change it so that there would be a variable for the items being passed in something like this?
DEClare @AssetList as varchar
Select * From Table
Where AssetType IN( @AssetList)
This will be used in a SSRS report
ASKER
Do you know if this will work in a SSRS report?
Don't know about T-SQL within an SSRS, but it will work in a Stored Procedure.
Tell me how 1, 2, 3 is determined, as there are other ways to pull off multiple-value parameters in SSRS.
Tell me how 1, 2, 3 is determined, as there are other ways to pull off multiple-value parameters in SSRS.
ASKER
they will probable enter them as a comma separated list in SSRS
1, 2, 3
1, 2, 3
ASKER
any query that you would suggest with SSRS?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ty
Open in new window