5 Fields Multiple Values

R

Ripper

I have five fields that can contain either 1 or 0. Let's call them Fields A,
B, C, D, E.

I need to write a query that will select them if any of the Fields A-E = 0.
Is there a better way than placing all variations of the five ones and zeros
in the Criteria area of the query?
 
R

Robbro

I'm new at this, so take this with a grain of salt but....

Add them then filter anything <5?
 
R

Ripper

I thought that too. Right after I sent the question. However, not everyone
will have all 5. Most will only have responses in 4.
 
J

John W. Vinson

I have five fields that can contain either 1 or 0. Let's call them Fields A,
B, C, D, E.

I need to write a query that will select them if any of the Fields A-E = 0.
Is there a better way than placing all variations of the five ones and zeros
in the Criteria area of the query?

One sneaky way: include a calculated field

AnyZero: [A]**[C]*[D]*[E]

If any one of them is zero, the product will be zero.

Alternativelly, use a criterion of

=0

on each of the five fields, on separate rows of the query grid to use OR
logic. There's no need to use =1 as a criterion if you're in fact looking for
zeroes.
 
R

Ripper

Perfect John. Kinda like the joke... What number do you get when you
multiply every hair on every human head together? Zero. There are people
out there who are genetically bald and any number times 0.....

Thanks the criterion worked perfect.
--
Rip


John W. Vinson said:
I have five fields that can contain either 1 or 0. Let's call them Fields A,
B, C, D, E.

I need to write a query that will select them if any of the Fields A-E = 0.
Is there a better way than placing all variations of the five ones and zeros
in the Criteria area of the query?

One sneaky way: include a calculated field

AnyZero: [A]**[C]*[D]*[E]

If any one of them is zero, the product will be zero.

Alternativelly, use a criterion of

=0

on each of the five fields, on separate rows of the query grid to use OR
logic. There's no need to use =1 as a criterion if you're in fact looking for
zeroes.
 
J

John W. Vinson

Perfect John. Kinda like the joke... What number do you get when you
multiply every hair on every human head together? Zero. There are people
out there who are genetically bald and any number times 0.....

LOL!

I like the "sucker bet" story: take the best and the worst baseball teams in
the US (you get to pick the teams). My score is the *sum* of the worst team's
score in each game this season; your score is the *product* of the best. High
score at the end of the season wins...
 

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