Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Crystal Reports Accept Multiple Parameters

Posted on 2011-02-11
3
1,854 Views
Last Modified: 2013-12-26
I have a report where I use a command to grab fields and there is a parameter that should be able to accept multiple inputs, however, when I run the report with multiple I get the following error:

Failed to retrieve data from the database
Details: ADO Error code 0x80040e14
Source: Microsoft OLE DB Provider for SQL Server
Description: Incorrect Syntax near ','.
SQL State: 42000
Native Error: 102 [Database Vendor Code : 102]

The query I have is below - the ASSIGNED_TO  is the problem.  The parameter has the box checked to allow multiple values - I'm not sure what the issue is here.


select nxstar_e.tar_num, (select nxsnotes.description from nxsnotes where id = nxstar_e.tar_num and nxsnotes.type = '1stcontact') as notedes, nxstar_e.assigned_to, nxstar_e.tar_status, nxstar_e.entered_date, nxstar_e.description, nxstar_e.bus_name
from nxstar_e where nxstar_e.entered_date >= {?EntryDate}
and nxstar_e.entered_date < DATEADD("d",1,{?EntryDate})
and nxstar_e.tar_status <> 'CLOSED'
and nxstar_e.assigned_to in ({?ASSIGNED_TO})

Open in new window

0
Comment
Question by:rondre
3 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 34874246
Are you running a command or is that a view in the database?

ry the last line as

and nxstar_e.assigned_to in {?ASSIGNED_TO}

mlmcc
0
 

Author Closing Comment

by:rondre
ID: 34874314
I am running a command - I thought I'd already tried that but I must have been wrong as that worked - thanks for the help and sorry to have wasted time :)
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 34874328
Two things:

1)  Quotes around the "d" in the dateadd function.  Double quotes denote a field name, which it isn't.  You're using Crystal syntax, not SQL syntax.

2)  You don't need the parentheses around the {?ASSIGNED_TO} parameter

Try the following code sample.

~Kurt

 
select
  nxstar_e.tar_num,
  (
  select
    nxsnotes.description
  from
    nxsnotes
  where
    id = nxstar_e.tar_num
    and nxsnotes.type = '1stcontact'
  ) as notedes,
  nxstar_e.assigned_to,
  nxstar_e.tar_status,
  nxstar_e.entered_date,
  nxstar_e.description,
  nxstar_e.bus_name
from
  nxstar_e
where
  nxstar_e.entered_date >= {?EntryDate}
  and nxstar_e.entered_date < DATEADD(day,1,{?EntryDate})
  and nxstar_e.tar_status <> 'CLOSED'
  and nxstar_e.assigned_to in {?ASSIGNED_TO}

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

789 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