Criteria

  • Thread starter Thread starter JoeCL
  • Start date Start date
J

JoeCL

Hello!

What would be the criteria on a query for a field with
data type of Yes/No? Or Cheched or Unchecked? Thank you.

Joe
 
All the Yes/No, True/False, Checked/Unchecked evaluate to -
1 for Yes/True/Checked and 0 for No/False/Unchecked.

So, you can use any of the above for the criteria, you can
also use an equation:

Name="Chris" would evaluate to True for me, false
for "Dave"


Chris Nebinger
 
-----Original Message-----
Hello!

What would be the criteria on a query for a field with
data type of Yes/No? Or Cheched or Unchecked? Thank you.

Joe
.
the criteria would be Yes or No:) only this
 
wrote:

Joe -

The Criteria in a query for Yes or No would be -1 for yes and 0 for no
Check box fields are the same -1 for a check and 0 for blanks.

Collee


-
Collee
 
This is exactly the correct answer for Jet. For MSDE, which also
comes with Access, it is 0 for false/no and 1 for true/yes. For
maximum portability of queries, I prefer to test = 0 for false, and <>
0 for true. In many ways, this mimics what both Jet and MSDE do. For
example, CBool(17) is true or -1. Any non-zero value is true.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Back
Top