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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection Criteria Syntax help

Status
Not open for further replies.

nickfatool

IS-IT--Management
Oct 8, 2001
30
AU
I'm going crazy here, struggling with selection syntax.
Code:
FName   MName     LName
----------------------------
Fred    James     Flinstone
Ted     Bertie    Beetle
Irene             Payne
Greg    Philpott  Brady
Ron               Birdseye
I want to exclude all records whose middle names = "James" or "Bertie". That should leave me with 3 of the 5 records..

I tried
Code:
 not ({query.MName} in ["James", "Bertie"]
"Greg Philpott Brady" was the only record returned, what happened to "Irene Payne" and "Ron Birdseye"?

In Access I could use "OR query.MName is Null" to include those names where "MName" was never initialized.
Any clues would be helpful, if you feel like elaborating, please go ahead.

Oh, and add some personality by including your middle name if you like also.


Cheers,

Robert "MacIntyre" Dexter.
 
You were on the right track in your thinking. Try this:

not ({query.MName} in ["James", "Bertie"]) or
IsNull({query.Mname})
Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
not ({query.MName} in ["James", "Bertie"]) or
IsNull({query.Mname})

should be

(IsNull({query.Mname}) or not ({query.MName} in ["James", "Bertie"]) )

Always test for a null in the first part of a formula or you will have problems Jim

JimBroadbent@Hotmail.com
 
Good one Jim, I missed it and should have known better. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top