Query criteria are conditions used to select specific records from a database. In Microsoft Access, you can use criteria to find students by course, fees, admission date, name, and other field values.
Query criteria are expressions that determine which records appear in the query results. Records that satisfy the conditions are displayed.
| StudentID | StudentName | Course | Fees |
|---|---|---|---|
| 101 | Amit | ADCA | 10000 |
| 102 | Priya | Tally Prime | 4000 |
| 103 | Rahul | ADCA | 8000 |
| 104 | Neha | Web Development | 12000 |
If you enter "ADCA" in the Course field's
Criteria row, the query displays Amit and Rahul.
| Field | StudentName | Course | Fees |
|---|---|---|---|
| Table | Students | Students | Students |
| Show | ✓ | ✓ | ✓ |
| Criteria | "ADCA" |
This query displays students whose Course field contains the value ADCA.
Comparison operators allow you to compare field values with a specified value.
| Operator | Meaning | Example Criteria |
|---|---|---|
| = | Equal to | =10000 |
| > | Greater than | >5000 |
| < | Less than | <5000 |
| >= | Greater than or equal to | >=10000 |
| <= | Less than or equal to | <=10000 |
| <> | Not equal to | <>10000 |
SELECT StudentName, Fees
FROM Students
WHERE Fees > 5000;
This query displays students whose fees are greater than 5000.
SELECT StudentName, Fees
FROM Students
WHERE Fees <> 10000;
This query returns students whose fees are not equal to 10000.
Text criteria are used to search fields containing names, course names, cities, and other text values.
SELECT *
FROM Students
WHERE Course = "ADCA";
This query finds students enrolled in ADCA.
SELECT *
FROM Students
WHERE StudentName LIKE "A*";
In the default Access ANSI-89 pattern syntax,
* matches zero or more characters.
The query finds names beginning with A.
SELECT *
FROM Students
WHERE StudentName LIKE "*an*";
This query finds names containing the character sequence "an".
% instead of
* as the multi-character wildcard in SQL
patterns. Use the wildcard syntax appropriate to your
database settings.
The AND operator is used when all specified conditions must be true.
SELECT *
FROM Students
WHERE Course = "ADCA"
AND Fees > 5000;
The query returns only students who are enrolled in ADCA and have fees greater than 5000.
SELECT *
FROM Students
WHERE Fees >= 5000
AND Fees <= 10000;
This query includes students whose fees are at least 5000 and no more than 10000.
The OR operator allows a record to match at least one of the specified conditions.
SELECT *
FROM Students
WHERE Course = "ADCA"
OR Course = "Tally Prime";
This query displays students enrolled in either ADCA or Tally Prime.
SELECT *
FROM Students
WHERE Fees < 5000
OR Fees > 10000;
This query finds students whose fees are outside the range from 5000 to 10000.
BETWEEN selects values within a specified range, including both endpoints.
SELECT StudentName, Fees
FROM Students
WHERE Fees BETWEEN 4000 AND 10000;
This query includes students with fees of 4000, 10000, and values between them.
SELECT StudentName, AdmissionDate
FROM Students
WHERE AdmissionDate BETWEEN #1/1/2026# AND #12/31/2026#;
This example finds records with admission dates in calendar year 2026. It assumes AdmissionDate is a Date/Time field.
IN allows you to match a field against a list of specified values.
SELECT *
FROM Students
WHERE Course IN ("ADCA", "Tally Prime", "Python");
This query returns students whose course is ADCA, Tally Prime, or Python.
IN can make a query shorter and easier to read than writing multiple OR conditions.
NULL indicates that a field has no stored value. It is different from zero or an empty text string.
SELECT *
FROM Students
WHERE Course IS NULL;
This query finds records where Course has a Null value.
SELECT *
FROM Students
WHERE Course IS NOT NULL;
This query returns records where Course is not Null.
Create a table named Students with these fields:
Goal: Practice text, numeric, date, range, and multiple-condition criteria in MS Access.
1. Which operator selects values within a range?
2. Which operator requires both conditions to be true?
3. Which condition finds records with a missing Null value in Course?