Logo
HOW TO
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
 
 
Windows 7

Microsoft Access 2010 : Using Criteria to Focus Query Results & Introducing Operators

5/28/2012 3:34:45 PM

1. Using Criteria to Focus Query Results

It’s unlikely that you’ll want your query to find every record in a table—if you did, you could just open the table and not bother with the query! To limit the records a query locates, such as finding customers only in Germany, you can add criteria to the fields in the Query design grid.

1.1. Set Query Criteria

  1. Open a query in Design view.

  2. Click the Criteria cell for the field to which the criterion will be applied.

  3. Click Builder.

  4. Create the criterion in the Expression Builder.

  5. Click OK.


Note:

You can also type the criterion into the Criteria cell directly.



Note:

To use a text string, enclose the string in quotation marks (for example, "Germany"). If you forget, Access adds the quotes if it recognizes the criterion as a text string.


2. Introducing Operators

There are several types of database objects and tools you need to use when you create a criterion to narrow the records returned by a query or to calculate a value. The first set of objects to which you need to refer includes database tables and their fields. For example, to calculate the subtotal of a line in the Northwind sample database’s Order Details table, multiply the Unit Price by the Quantity ordered, and adjust the total if the customer gets a discount (as noted in the Discount field). The expression to perform the first part of that calculation is [Order Details]![UnitPrice]*[Order Details]![Quantity].

Note that table fields are called out with the name of the table enclosed in square brackets, an exclamation point, and then the name of the field in square brackets.

2.1. Arithmetic Operators

OperatorDescription
-Subtraction (6-4=2)
*Multiplication (6*4=24)
/Division (6/4=1.5)
\Integer division (6\4=1)
+Addition (6+4=10)
ModModular division (6 Mod 4=2)

2.2. Comparison Operators

OperatorDescription
<Less than
<=Less than or equal to
<>Not equal to
=Equal to
>=Greater than or equal to
>Greater than
Between "Value1" And "Value2"Between two values, inclusive (for example, Between "1" And "3" would return "1, 2, 3")

2.3. Logical Operators

OperatorDescription
ANDBoth elements of an expression must be true.
NOTThe expression must evaluate as false.
ORAt least one element of an expression must be true.
XORExactly one element of an expression must be true, not both.
Other -----------------
- Microsoft Excel 2010 : Changing Summary Calculations, Showing and Hiding Data Items, Sorting Your Pivot Table
- Microsoft Excel 2010 : Changing the Pivot Table Layout, Customizing Field Names & Applying Numeric Formats to Data Fields
- Microsoft Word 2010 : Performing Mail Merges - Performing a Basic Mail Merge
- Microsoft Word 2010 : Performing Mail Merges - Performing a Basic Mail Merge
- Windows 7 User Mode Drivers Overview and Operation : Driver Callback Interfaces, UMDF Driver Features
- Windows 7 User Mode Drivers Overview and Operation : Devices Supported in User Mode & UMDF Model Overview
- Microsoft Project 2010 : Setting Up a Project Budget - Reviewing Cost Information
- Microsoft Project 2010 : Setting Up a Project Budget - Preparing for Cost Calculations
- Microsoft Outlook 2010 : Processing Messages Automatically - Creating and Using Quick Steps
- Microsoft Outlook 2010 : Processing Messages Automatically - Using Rules to Move Messages Between Accounts & Running Rules Manually and in Specific Folders
 
 
REVIEW
- First look: Apple Watch

- 10 Amazing Tools You Should Be Using with Dropbox

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
 
VIDEO TUTORIAL
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
 
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
Top 10
- Microsoft Excel : How to Use the VLookUp Function
- Fix and Tweak Graphics and Video (part 3) : How to Fix : My Screen Is Sluggish - Adjust Hardware Acceleration
- Fix and Tweak Graphics and Video (part 2) : How to Fix : Text on My Screen Is Too Small
- Fix and Tweak Graphics and Video (part 1) : How to Fix : Adjust the Resolution
- Windows Phone 8 Apps : Camera (part 4) - Adjusting Video Settings, Using the Video Light
- Windows Phone 8 Apps : Camera (part 3) - Using the Front Camera, Activating Video Mode
- Windows Phone 8 Apps : Camera (part 2) - Controlling the Camera’s Flash, Changing the Camera’s Behavior with Lenses
- Windows Phone 8 Apps : Camera (part 1) - Adjusting Photo Settings
- MDT's Client Wizard : Package Properties
- MDT's Client Wizard : Driver Properties
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro