Topics Search

logical operators in a query

logical operators in a query
Views: 9
I am using the below expression in an update query:

([tblItemMaster]![RuleMet1] = "Yes" AND [tblItemMaster]![RuleMet2] = "No")
OR ([tblItemMaster]![RuleMet1] = "No" AND [tblItemMaster]![RuleMet2] = "Yes")
[tblItemMaster]![ItemQualified] ="No", "")

I have records in tblItemMaster that meet the criteria:
([tblItemMaster]![RuleMet1] = "Yes" AND [tblItemMaster]![RuleMet2] = "No")
([tblItemMaster]![RuleMet1] = "No" AND [tblItemMaster]![RuleMet2] = "Yes")

However [ItemQualified] does not get updated to "No" in tblItemMaster.

I am not sure if I used correct syntax for logical operators
Sponsored Links:

More topics


Logical Operators in Access SQL

Originally, logical operators were a concept from algebra used to exclude and include number sets. They are, very simply, NOT, AND, and OR. Sometimes this set is expanded to combinations of the operators, but at core it's only these three. The logical operators are often referred to as the Boolean operators.

Table of operators

An operator is a sign or symbol that specifies the type of calculation to perform within an expression. There are mathematical, comparison, logical, and reference operators. Access supports a variety of operators, including arithmetic operators such as +, -, multiply (*), and divide (/), in addition to comparison operators for comparing values, text operators for concatenating text, and logical operators for determining true or false values. This article provides details about using these operators.

Query Criteria In Access 2010 Through Logical Operators

As the name implies, Query pulls out specific data from table fields included in database, thus, setting specific criterion in query helps you to filter down the table field data according to your needs. Through simple logical operators in Query Criteria you can set a criteria by using simple AND/OR operators, which lets you to confine the results of a query based upon the query criteria to check which table field data is to be included.

Exploring Data Analysis

To further enhance your filtering capabilities, you can use Boolean algebra combined with the operators we have used so far. Besides the logical operators we know already, Boolean algebra adds extra operators used to concatenate expression.

Database Operators and Operands

The fields we have been using allow the user to enter, view, or change data of a database. Because there is so many types of values a user can be ask to deal with, the values in the fields are categorized by types. Learn: Overview of Operators and Operands, Constants, Operators, Logical Operators.

Database Conditional Values

1) Boolean Values
2) Logical Constants
3) Logical Operations
4) Logical Functions
5) Value Checking Functions
6) Logical Comparisons
The above mentioned topics are covered in this Access 2007 tutorial.

Data analysis: Querying a Database

To query the records of a database, you can use Boolean algebra combined with some operators. Boolean Algebra works on logical statements. A statement is a sentence that acknowledges a fact or a possibility. That fact is eventually evaluated as being true or false.

Techniques of Data Analysis

Data analysis consists of examining the records of a table, an already existing query, or a form, to isolate records that respond to one or more criteria. To assist you with this, Microsoft Access provides all the (visual) tools you need. These include filtering by form and logical junction operators.

Database Conditional Values

A value is referred to as Boolean when it is either true or false. In other words, the value only be one or the other, never both, and not any other value. To support Boolean values, Microsoft Access provides a data type named Boolean.
Learning Objective: Boolean Values, Logical Constants, Logical Operations, Logical Functions, Value Checking Functions, Logical Comparisons.

Details on Creating Queries

In this tutorial you will learn about creating queries. Topics: Details on Column Selection, Introduction to Logical Operators and Pattern Operator: LIKE.