Results 1 to 2 of 2

Thread: [BI Developer] IN Clause with multi value from Report parameters.

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Seraph's Avatar
    Join Date
    Jul 2007
    Posts
    959

    [BI Developer] IN Clause with multi value from Report parameters.

    Having trouble finding someone who addresses this issue I am having.

    I am using the BI Developer in Visual Studio 2008 to create a report that hits a SQL Server database.

    I have a dropdown of sales reps and it can have multiple selections.
    So, this means that the Report tries to pass a string of numbers (since the SalesRepID is the value that is passed).
    So, the id's could be "9,5,10". This is supposed to go into an IN clause to pull the correct records based on ID.

    If a single person is selected, it is passed as an integer (or a string, but at least converted properly) and the IN clause finds the person properly as the SalesRepID is a numeric value.
    But, if I choose multiple people, it says it can't convert the incoming string to an integer to be able to compare. Obviously makes sense, but a problem.

    Does anyone know a way around this, be it a setting in the report? Or maybe even some SQL code that can get it to work?

    The error I get is this:
    An error occurred during local report processing. An error has occurred during report processing. Query execution failed for dataset 'SO_CommissionReport'. Conversion failed when converting the varchar value '142,132' to data type int.

    I tried casting the field into a string, but that didn't work:

    WHERE Cast(a.SalesRepID As varchar(10)) IN (@SalresRep)
    Last edited by Seraph; Mar 16th, 2012 at 08:18 AM.

    Visual Studio 2010 Professional | .NET Framework 4.0 | Windows 7

    SERYSOFT.COM :: SysPad - Folder Management Program - Please comment HERE if you find this program useful, have ideas, or know of any bugs.
    [Very useful for IT/DP departments where many folders are consistently accessed. Also contains a scratchpad window for quick access to notes.]

    [.NET and MySQL Quick Guide]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width