syatax error in crystal reports while passing paramete to stored procedure like '(7,10)' gives error sysntax error near 'AND'

Posted on 2007-10-18
Last Modified: 2013-11-14
Not supported.
Details: ADO Error Code: 0x80040e14
Source: Microsoft OLE DB Provider for SQL Server
Description: Incorrect syntax near the keyword 'AND'.
SQL State: 42000
Native Error: 156

I didnt get the above error if i manually pass the paramete to procedure like '(7,10)'
but report gives error when i pass the parameter like @ClientType

please suggest what would be the problem?
Question by:s_chilkury
    LVL 5

    Expert Comment

    May i see the query you are using inside SP?
    LVL 42

    Accepted Solution

    I suspect that @ClientType returns a result of (7,10) not of '(7,10)' which would account for the error.

    Change your formula to explicitly return the single quotes around the value and you should be fine.

    LVL 2

    Expert Comment

    I'd agree with frodoman, but I'd probably just add the single quotes into the SQL Command around the parameter.
    LVL 42

    Expert Comment

    >>> I'd probably just add the single quotes into the SQL Command around the parameter

    But you have to be careful with this because your db driver may interpret that as text and not as a bind variable within quotes - depends on the driver of course but for universal consistency I wouldn't recommend this approach.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
    Just about everyone has an old PC laying around.  Ask anyone in the IT industry, whether they are a professional or play in it as a hobby.  From outdated Desktops to cheap "throwaway" laptops, they are all around and not as hard to "fix up" as you m…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now