Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal Reports Accept Multiple Parameters

Posted on 2011-02-11
3
Medium Priority
?
1,962 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 101

Accepted Solution

by:
mlmcc earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

916 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