471,594 Members | 1,374 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

Problem with IN statement in Stored Procedure

I have a asp.net web page that uses a Crystal report. The report gets its data from a stored procedure that has three parameters @Startdate,@enddate and @teams. The page passes @Teams with multi values to a stored procedure using a IN statement. Here is the stored Procedure:
Select sum(Value1)as Value1_count
, sum(Value2) as Value2_count
, sum(Value3) as Value3_count

FROM Table1
WHERE Act_date between @startdate and @enddate and Team in('+ @Teams+')
Passing one value works but two or more doesn't.
The parameter value is passed like:
Teams.Value = "Value1,Value2"
Nov 3 '06 #1
0 1372

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Jason Callas | last post: by
2 posts views Thread by Kent Lewandowski | last post: by
5 posts views Thread by Timppa | last post: by
8 posts views Thread by dthmtlgod | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.