query based on 2 fields when either one is true

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

Guest

Hi
I have a field for "Kids under 7" and a field for "Kids under 10" i would
like to have a query where either one of them is set to "yes"
 
Mr. G said:
Hi
I have a field for "Kids under 7" and a field for "Kids under 10" i would
like to have a query where either one of them is set to "yes"

Mr. G,

Unnecessary Commentary: I *strongly* recommend a table redesign to
eliminate repeating columns, and to eliminate any spaces in column
names.

But that aside:

UPDATE Kids
SET [Kids under 7] = -1
,[Kids under 10] = -1


Sincerely,

Chris O.
 
Mr. G said:
I have a field for "Kids under 7" and a field for "Kids under 10" i would
like to have a query where either one of them is set to "yes"


Better to calculate the ages on the fly than have that data
in a table . . .

But I think you want to set the criteria for Under7 to "Yes"
(or True). Then, in a different criteria row, do the same
for Under10.
 
I'll try to exlpain a little bit better.
these fileds are general questions that are filled out on an application
without going in to detail of how many kids they have and thier birth dates.
So; I want to have a query with either one of them answered "yes" by doing as
you suggested it will only bring up those who have both a "yes".
 
Did you put the criteria on different rows?

It sounds like yours is set up as an AND instead of an OR.

Debbie

| I'll try to exlpain a little bit better.
| these fileds are general questions that are filled out on an application
| without going in to detail of how many kids they have and thier birth dates.
| So; I want to have a query with either one of them answered "yes" by doing as
| you suggested it will only bring up those who have both a "yes".
|
| "Marshall Barton" wrote:
|
| > Mr. G wrote:
| > >I have a field for "Kids under 7" and a field for "Kids under 10" i would
| > >like to have a query where either one of them is set to "yes"
| >
| >
| > Better to calculate the ages on the fly than have that data
| > in a table . . .
| >
| > But I think you want to set the criteria for Under7 to "Yes"
| > (or True). Then, in a different criteria row, do the same
| > for Under10.
| >
| > --
| > Marsh
| > MVP [MS Access]
| >
 
It should work.

Please post the SQL.

What data type is [Kids under 7] and [Kids under 10]?


| Yes this is the way it looks.
|
| sorry for responding so late, but thanks again.
|
| "DebbieG" wrote:
|
| > Please post the SQL.
| >
| > Your Where should look similar to this:
| >
| > ....
| > WHERE ((([Kids under 7])="yes")) OR ((([Kids under 10])="yes"));
| >
| >
| > | > | Thank you very much.
| > |
| > | I did put the criteria on different rows
| > |
| > | "DebbieG" wrote:
| > |
| > | > Did you put the criteria on different rows?
| > | >
| > | > It sounds like yours is set up as an AND instead of an OR.
| > | >
| > | > Debbie
| > | >
| > | > | > | > | I'll try to exlpain a little bit better.
| > | > | these fileds are general questions that are filled out on an
application
| > | > | without going in to detail of how many kids they have and thier
birth
| > dates.
| > | > | So; I want to have a query with either one of them answered "yes"
by doing
| > as
| > | > | you suggested it will only bring up those who have both a "yes".
| > | > |
| > | > | "Marshall Barton" wrote:
| > | > |
| > | > | > Mr. G wrote:
| > | > | > >I have a field for "Kids under 7" and a field for "Kids under
10" i
| > would
| > | > | > >like to have a query where either one of them is set to "yes"
| > | > | >
| > | > | >
| > | > | > Better to calculate the ages on the fly than have that data
| > | > | > in a table . . .
| > | > | >
| > | > | > But I think you want to set the criteria for Under7 to "Yes"
| > | > | > (or True). Then, in a different criteria row, do the same
| > | > | > for Under10.
| > | > | >
| > | > | > --
| > | > | > Marsh
| > | > | > MVP [MS Access]
| > | > | >
| > | >
| > | >
| > | >
| >
| >
| >
 
Back
Top