Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8717885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:23:53+00:00 2026-06-13T06:23:53+00:00

I am working on a simple report in Visual Studio 2010 where originally I

  • 0

I am working on a simple report in Visual Studio 2010 where originally I have a direct query:

SELECT     
   DOCDATE, DOCID, CUSTNMBR, CUSTNAME, DOCAMNT
FROM         
   SOP30200
WHERE     
   (DOCDATE BETWEEN @Fromdate AND @Todate)
GROUP BY 
   DOCDATE, DOCID, CUSTNMBR, CUSTNAME, DOCAMNT
HAVING 
   (CUSTNAME = @Custname OR @Custname IS NULL) AND (DOCID IN (@DocID))

with the DOCID parameter set to “Allow multiple values” which works great.

However, when I create a stored procedure:

CREATE Procedure [dbo].[Jae_EraSales]  
   @Custname nVARCHAR(MAX),
   @DocID nVARCHAR(50),
   @Fromdate datetime,
   @Todate datetime
as
   SELECT     
      DOCDATE, DOCID, CUSTNMBR, CUSTNAME, DOCAMNT
   FROM         
      SOP30200
   WHERE     
      (DOCDATE BETWEEN @Fromdate AND @Todate)
   GROUP BY 
       DOCDATE, DOCID, CUSTNMBR, CUSTNAME, DOCAMNT
   HAVING      
       (CUSTNAME = @Custname) AND (DOCID IN (@DocID))
GO

and use the stored procedure as my dataset…the SSRS report does not pull anything. It only pulls data with a single DOCID value.

Would anyone be able to explain why that is happening?

Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:23:54+00:00Added an answer on June 13, 2026 at 6:23 am

    When you use IN it looks at a set and not a single string expression. Because of this you need to implement a function such as CsvToInt to return a table.

    IN expects an array not a variable, someone asked a very similar question which will definitely help you: tsql IN not working properly if passed as parameter

    The gist of it is simply writing a function that returns a table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple query like this SELECT * FROM MY_TABLE; When I run
I have a simple form, a query and a report in Access 2003. I
The simple working query, list the number of licenses for each license type: Query:
Good Day, I have a simple working routine in Perl that swaps two words:
I have what I think is a pretty simple question. I have a report
I am working on a simple standalone desktop application which would generate report based
I'm working on a report in reporting services that has the user select a
Hi all: I'm working on a visual Studio setup program. The problem is that
Morning all, Using C# .NET 4.0 and Visual Studio 2012 Express. I have a
I'm trying to make a simple text editor with winapi, its working for simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.