Design View Criteria question

  • Thread starter Thread starter archico01
  • Start date Start date
In design view of a query, what will be the output difference in the
following photos? What will happen to the data if I put the other criteria in
the "Or" column? Please click link. Thanks a lot guys!

http://i33.photobucket.com/albums/d98/archico01/qry.jpg
http://i33.photobucket.com/albums/d98/archico01/qry2.jpg

The first query will use AND logic: it will return those records for which the
first field is equal to 123, and (in the same record) the second field is
equal to 456.

The second query will use OR logic: it will return those records for which the
first field is equal to 123 (regardless of the value in the second field), as
well as all those records where the second field is equal to 456 (regardless
of the value in the first field).

Boolean Algebra is a wonderfully powerful but not necessarily intuitive
mindset. I owe Coach Clell Burnett, Bentonville High School, 1963 a lot of
credit for introducing me to the concept; and it's absolutely at the basis of
query design.

True AND True = True
True AND False = False
False AND True = False
False AND False = False

True OR True = True
True OR False = True
False OR True = True
False OR False = False

John W. Vinson [MVP]
 
John W. Vinson said:
The first query will use AND logic: it will return those records for which the
first field is equal to 123, and (in the same record) the second field is
equal to 456.

The second query will use OR logic: it will return those records for which the
first field is equal to 123 (regardless of the value in the second field), as
well as all those records where the second field is equal to 456 (regardless
of the value in the first field).

Boolean Algebra is a wonderfully powerful but not necessarily intuitive
mindset. I owe Coach Clell Burnett, Bentonville High School, 1963 a lot of
credit for introducing me to the concept; and it's absolutely at the basis of
query design.

True AND True = True
True AND False = False
False AND True = False
False AND False = False

True OR True = True
True OR False = True
False OR True = True
False OR False = False

John W. Vinson [MVP]
Then there is XOR (Exclusive OR) --
True XOR True = False
True XOR False = True
False XOR True = True
False XOR False = False
 
John said:
The first query will use AND logic: it will return those records for which the
first field is equal to 123, and (in the same record) the second field is
equal to 456.

The second query will use OR logic: it will return those records for which the
first field is equal to 123 (regardless of the value in the second field), as
well as all those records where the second field is equal to 456 (regardless
of the value in the first field).

Boolean Algebra is a wonderfully powerful but not necessarily intuitive
mindset. I owe Coach Clell Burnett, Bentonville High School, 1963 a lot of
credit for introducing me to the concept; and it's absolutely at the basis of
query design.

True AND True = True
True AND False = False
False AND True = False
False AND False = False

True OR True = True
True OR False = True
False OR True = True
False OR False = False

John W. Vinson [MVP]
===============================

Thanks a lot man!
 
Back
Top