I have case where I have a multi-valued field that contains integer values stored as nvarchar data type. I am in a FOR EACH loop, and it contains a Custom SQL Query. Now if I pass in a single value in single quotes to the SQL below, it works. But if I pass in multiple values in single quotes, no rows are affected.
My SQL looks like this:
IF (@Status IN ('E' , 'R'))
SELECT * FROM [Custom_LF_Data].[dbo].[AS400MAUQuotes]
WHERE CAST([QuoteNumber] AS varchar) IN (@QuoteNr) AND [Status] <> 'A'
How would I get my @QuoteNr, which is defined as %(MultiQuoteNumber#[, ]#), to work if I have more than one value in my multi-valued field?