Creating an "or" query on different data fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I am trying to do a query which involves two different data fields. I am
looking for those who have a "yes" value in either data field to run a list.
When I use the query function and enter crteria, Access automatically does an
"and" function and only gives me those that have a "yes" response to both
data fields. How can I change that to an "or" instead? I have tried moving
the second data field below the first data field in "or" section of the query
and Access responds by automatically moving it up to the top of the next
"data" field of the query. Thanks for the help.
 
Are you saying you put the criteria for the first field on the first Criteria
row in the query builder and the criteria for the second field on the second
Criteria row?
That should give you an Or.
Are both fields in the table text fields?
Will you expect to find the literal values "yes" in either of the fields?
 
Hey Klatuu,

Both fields are text fields. I have them set up numerically as "1" or "0"
to indicate yes or no. I am using a design view to set up the query. On the
header i am using three tables. The first is a Master table containing name
and address info. The other two tables contain the data I am looking to
examine. The two data tables are both joined to the master table as well as
to each other.

I am moving in the information of name, address in the first two columns of
deisgn view without criterior. I am then moving the data field from the the
second displayed table into the third design view field and putting in the
criteria of "1". Up to here all is well. Now, I am trying to move a data
field from the third table down into the same design view column I placed the
previous variable. I am going into the third table, clicking the variable
and moving it from the table onto the line which says "or" in the design view
column. rather than leaving this variable field in the "or" position, it
immeiately moves the variable into the data field the "field" section of the
column immediately to the right.

If this isn't clear, I'd be happy to send a screen shot of the dilemna if
possible?????


Again, thanks
 
I don't follow this sentence:
Now, I am trying to move a data
field from the third table down into the same design view column I placed the
previous variable

variable is not in context here. But I think I see the problem. each field
goes in a separate column in the field row. It should look sort of like this:

Field: SomeField AnotherField AnyField UselessField
Table: Table1 Table2 Table3 Table3
Sort:
Show:
Criteria: "1"
Or: "1"

This would translate to
WHERE AnotherField = "1" Or UselessField = "1"
 
Back
Top