Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The "IN" keyword to select records...

Status
Not open for further replies.

bgravi

Programmer
Jul 28, 2002
15
0
0
US
I need to have a formula similar to the following Sql statement
SELECT au_lname, state FROM authors state IN ('CA', 'IN', 'MD')
which is the equivalent of
WHERE state = 'CA' OR state = 'IN' OR state = 'MD'

Does Crystal Reports support this form of "IN" statement? I tried to do it but it threw an error. Since my list may have quite a few elements based on user input, it would have been nice to have the "IN" keyword, instead of using the "OR".

Thank you
 
This a Crystal "Is One Of"

The formula syntax uses square brackets:

{state} IN ['CA', 'IN', 'MD'] Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
It appears to be case sensitive. How can make it case-insensitive? I am setting the DataDefinition.RecordSelectionFormula value at runtime. I am using CR with VS.Net
 
Uppercase ({state}) in ["CA", "IN"] Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I wish it were that simple !! The search values depend on user input. The user might enter it in lower or upper case. The data in the database is also populated by the user. So, the string match must be case-insensitive.

Thank you
 
But you are capturing the input in an application you are writing, no? So, you can convert the user selection to upper case as you build the selection formula. The upper case on the field takes care of the data side. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top