Searching and processing data by a given pattern in MS Access
For quick searching in a table use Home – Find (Ctrl+F); sort and filter buttons are also on the Home tab, and a column is sorted by choosing A→Z or Z→A. A filter temporarily shows only the matching records and deletes no data; Toggle Filter cancels a filter and Remove Sort cancels a sort. For a permanent question, add the table in Create – Query Design, move the fields into the grid and write a condition in the Criteria row: text in quotation marks (“10A”), numbers as >=4 or Between 4 And 5, and a pattern as Like “G*” (starting with G). Conditions in one row work as “And” (all must be met), those in different rows as “Or” (at least one). In a parameter query the condition holds a question in square brackets, for example [Enter a name]; the query asks for the value every time it runs. The result is viewed with Run, and saving the query lets you reuse it later.
| Criteria | Meaning |
|---|---|
| "10A" | text – in quotation marks |
| >=4 | a number condition |
| Between 4 And 5 | includes the limits |
| Like "G*" | starts with G |
A PE teacher with a table of hundreds of running results wants to see only the results in a certain range. The teacher put on a filter, hid the rest for the moment and sorted the fastest to the top. No record was deleted, and removing the filter brings everything back.
Online shops offer filters by price; librarians, analysts and help desks pick out the records they need with queries.
Write 6 invented items and their prices in your notebook; underline in colour those cheaper than a chosen limit – this is a filter done by hand.
| Name | Class | Mark |
|---|---|---|
| Anvar | 10A | 5 |
| Bobur | 10B | 4 |
| Dilnoza | 10A | 3 |
| Eldor | 10A | 5 |
| Farida | 10B | 5 |
| Gulnora | 10A | 4 |
| Hasan | 10B | 3 |
| Iroda | 10A | 5 |
| Name | Class | Mark |
|---|---|---|
| Anvar | 10A | 5 |
| Bobur | 10B | 4 |
| Dilnoza | 10A | 3 |
| Eldor | 10A | 5 |
| Farida | 10B | 5 |
| Gulnora | 10A | 4 |
| Hasan | 10B | 3 |
| Iroda | 10A | 5 |
“The search workshop”: a pair makes an 8-row table, builds queries with three conditions (a text pattern, a range, And) and checks the results against their own prediction.