OR criteria

  • Thread starter Thread starter degas1900
  • Start date Start date
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.
 
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.
 
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?
 
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
'====================================================
 
Post the SQL of your query. Open in design view, click on SQL View,
highlight all , copy, and paste in a post.
 
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];
 
Back
Top