I am using the directions for speeding up an SSRS report shown in a question Here. But the difference on this query is that one of the parameters from the SSRS report results in a list of strings, example:
'100031', '100131', '114647', '115101'
Here is the query I'm trying(With the parameters hardcoded) but the VarChar doesn;t work. is there a data type i can use to accomplish what is in the above mentioned link with a list of strings?
Declare @cust as VarChar(Max)
set @cust =
'100031',
'100131',
'114647',
'115101'
SELECT
DELIVERYNAME + ' ' + DELIVERYADDRESS AS 'Deliverly'
FROM
dbo.SALESLINE INNER JOIN
dbo.CUSTPACKINGSLIPTRANS ON ORIGSALESID = dbo.SALESLINE.SALESID AND dbo.SALESLINE.ITEMID = dbo.CUSTPACKINGSLIPTRANS.ITEMID
WHERE
CUSTACCOUNT in (@cust)
AND
dbo.CUSTPACKINGSLIPTRANS.CREATEDDATE BETWEEN '08/03/2015' AND '08/07/2015'
AND
dbo.SALESLINE.DIMENSION2_ IN ('08')