Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, it is possible to use the Like operator in conjunction with an If condition in the Query Criteria Box in MS Access. Here is an example:

Suppose you have a table called "Products" with fields "ProductID" and "ProductName". You want to retrieve all products whose name starts with "A" or "B". You can create a query and use the following criteria in the "ProductName" field:

Like "A" Or Like "B"

This will retrieve all products whose name starts with "A" or "B". Now suppose you want to create a query that retrieves all products whose name starts with "A" or "B" and whose ProductID is greater than or equal to 100. You can use the following criteria:

If([ProductID]>=100,Like "A" Or Like "B")

This will retrieve all products whose name starts with "A" or "B" and whose ProductID is greater than or equal to 100.