October 4, 2013 at 8:47 am
Hi All,
I have the following stored procedure:
CREATE PROCEDURE dbo.ScoreHistory
@StartDate int,
@EndDate int,
@membercode nvarchar(1),
@Source nvarchar(2)
AS
SELECT DISTINCT(S.Score) AS Score, COUNT(U.ScoreID) AS Count
FROM UPSELL U
INNER JOIN ScoreMap S
ON S.ScoreID = U.ScoreID
WHERE SEARCHDATE BETWEEN @StartDate AND @EndDate
AND membercode = @membercode
AND PubCode = @Source
GROUP BY S.Score
What I need to be able to do is change the above to use the IN() statement on the variables @membercode and @Source. Any help will be appreciated.
EO
October 4, 2013 at 8:53 am
...
AND membercode IN (@membercode)
AND PubCode IN (@Source)
...
John
October 4, 2013 at 9:00 am
eobiki10 (10/4/2013)
What I need to be able to do is change the above to use the IN() statement on the variables @membercode and @Source. Any help will be appreciated.EO
Why would you need that? your variables ar nvarchar(1) and nvarchar(2).
The equal sign would be the same as an IN with a single value.
Maybe you're giving us incorrect information and that way you might get incorrect solutions.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply