Programming

MS Access 2016 Query Criteria Quick Reference Guide

Simple criteria for all data types:
Criteria Name Write it like… Function
1 Equals “x” Searches for values equal to x
2 Does Not Equal Not in (“x”) Searches for all values except those equal to x
3 Null Is Null Searches for empty fields
4 Not Null Is Not Null Searches for non-empty fields
Simple criteria for text:
Criteria Name Write it like… Function
1 Contains Like “*x*” Searches for all values that contain x
2 Does Not Contain Not like “*x*” Searches for all values except those that contain x
3 Begins With Like “x*” Searches for all values beginning with x
4 Ends With Like “*x” Searches for all values ending with x
5 Comes After >= “x” Searches for all values that come after x in alphabetical order
6 Comes Before <= “x” Searches for all values that come before x in alphabetical order
Simple criteria for numbers:
Criteria Name Write it like… Function
1 Between Between “x” and “y” Searches for values in the range between x and y
2 Less Than < x Searches for all values smaller than x
3 Less Than or Equal To <= x Searches for all values smaller than or equal to x
4 Greater Than > x Searches for all values larger than x
5 Greater Than or Equal To >= x Searches for all values larger than or equal to x
Simple criteria for dates:
Criteria Name Write it like… Function
1 Between Between “#mm/dd/yyyy#” and “#mm/dd/yyyy#” Searches for dates that fall between two dates
2 Before <#mm/dd/yyyy# Searches for dates before a certain date
3 After >#mm/dd/yyyy# Searches for dates after a certain date
4 Today =Date() Searches for all records containing today’s date
5 Days Before Today <=Date()-x Searches for all records containing dates x or more days in the past

Leave a Reply

Your email address will not be published. Required fields are marked *