OR criteria

D

degas1900

Using Access 2003. I'm trying to develop a criteria that has multiple OR
options, but I can't figure out how to use the OR criteria choice. This is
what I want: I only want to list the records that have Red, Green or Blue in
the Color field. I do not want any records with Yellow or Purple. I chose
the Color field, and entered Red, Green, Blue under Criteria / Or. But only
the records with Red appear when a run the query. What am I doing wrong?
I'm a newbie with Access and the Help instructions and tutorials make no
sense.
 
K

KARL DEWEY

The below placed in the criteria row under your Color field will ONLY pull
records with one of the colors.
"Red" OR "Green" OR "Blue"
You do not have to worry about any records with Yellow or Purple.
 
S

Steve

Under the color field in your query, put "Red" in the first criteria line,
"Green" in the second criteria line and "Blue" in the third criteria line.

Steve
(e-mail address removed)
 
D

degas1900

That's why I've been doing umpteen times, but it still spits out all records,
not just the ones I want. Maybe if someone could post a screenshot of what
the query should look like?
 
J

John Spencer

Better yet. You post the SQL statement.

Open the query in design view and then select View: SQL from the menu.

Copy and paste the SQL statement into your post and someone should be
able to examine it and determine what the problem is.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
K

KARL DEWEY

Post the SQL of your query. Open in design view, click on SQL View,
highlight all , copy, and paste in a post.
 
S

Steve

Did you put "Red" , "Green" and "Blue" on separate lines in the same
column?

Steve
(e-mail address removed)
 
D

degas1900

Here it is (this is a criminal case, so don't be alarmed at the "nature of
incident"):

SELECT TampaBay.ID, TampaBay.[Report Date], TampaBay.[Incident(s) Date],
TampaBay.[Nature of Incident(s)], TampaBay.[Number of persons involved],
TampaBay.[Location of incident(s)], TampaBay.[Exhibit Image], TampaBay.[Case
Number]
FROM TampaBay
WHERE (((TampaBay.[Nature of Incident(s)])<>"runaway" Or (TampaBay.[Nature
of Incident(s)])>="sexual" Or (TampaBay.[Nature of Incident(s)])>="lewd" Or
(TampaBay.[Nature of Incident(s)])>="molestation" Or (TampaBay.[Nature of
Incident(s)])<>"theft"))
ORDER BY TampaBay.[Report Date];
 
S

Steve

Out of ....
"runaway"
"sexual"
"lewd"
"molestation"
"theft"
which records do you want?

Steve
(e-mail address removed)

degas1900 said:
Here it is (this is a criminal case, so don't be alarmed at the "nature of
incident"):

SELECT TampaBay.ID, TampaBay.[Report Date], TampaBay.[Incident(s) Date],
TampaBay.[Nature of Incident(s)], TampaBay.[Number of persons involved],
TampaBay.[Location of incident(s)], TampaBay.[Exhibit Image],
TampaBay.[Case
Number]
FROM TampaBay
WHERE (((TampaBay.[Nature of Incident(s)])<>"runaway" Or (TampaBay.[Nature
of Incident(s)])>="sexual" Or (TampaBay.[Nature of Incident(s)])>="lewd"
Or
(TampaBay.[Nature of Incident(s)])>="molestation" Or (TampaBay.[Nature of
Incident(s)])<>"theft"))
ORDER BY TampaBay.[Report Date];



John Spencer said:
Better yet. You post the SQL statement.

Open the query in design view and then select View: SQL from the menu.

Copy and paste the SQL statement into your post and someone should be
able to examine it and determine what the problem is.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top