Solved

Parameters - bring all values back

Posted on 2014-09-22
6
112 Views
Last Modified: 2014-09-23
I am using CR2008

I using a SQL command in my report.

I have a number values in a parameter and it allows multiple values

The synatx is as follows

where (MA_SchemeID IN {?Scheme} and {?Scheme}  = 0)

I am using {?Scheme}  = 0 to bring back all values, but this is not working

Can anybody help with the correct syntax?

Thanks
0
Comment
Question by:halifaxman
6 Comments
 
LVL 22

Expert Comment

by:Ido Millet
ID: 40336878
Change "and" to "OR"
0
 

Author Comment

by:halifaxman
ID: 40338512
Thanks for the answer

I have changed it to or and get the following error message

An expression of non-boolean type specified in a context where a condition is expected near a ','
0
 
LVL 34

Accepted Solution

by:
James0628 earned 500 total points
ID: 40338717
FWIW, Ido was correct about needing OR there.  As for the error ...

 If the parameter allows multiple values, then I would guess that {?Scheme}  = 0 is getting translated into something like (1,2,3) = 0, and that's what is causing the error.

 Try this

where (MA_SchemeID IN {?Scheme} OR 0 IN {?Scheme})

 Note that if you enter values for the parameter like 1, 2, 3 and 0, that would count as "all", because one of the parameter values is 0.

 Also, now that I think about it, if you think that you might be using the "all" option a lot, it might be more efficient to put the "all" test first:

where (0 IN {?Scheme} OR MA_SchemeID IN {?Scheme})

 It probably wouldn't make much difference.  It just occurred to me that it might be more efficient.

 James
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

Expert Comment

by:mlmcc
ID: 40338990
If that doesn't help, post the new formula.

If this is part of the selection formula then please post the full formula.

mlmcc
0
 

Author Closing Comment

by:halifaxman
ID: 40339169
Thanks - much appreciated
0
 
LVL 34

Expert Comment

by:James0628
ID: 40339388
You're welcome.  FWIW, Ido really deserves some of the points, because he posted part of the solution.  If you like, you can ask to have the question re-opened and then split the points between us.

 James
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
across tab - Distinct Count - Crystal Reports 2 76
C# Crystal Reports 15 79
Crystal Reports Format Field with Dashes 6 41
Pull date to Group header 6 26
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

23 Experts available now in Live!

Get 1:1 Help Now