How to combine criteria

M

morgan

I want a query that extracts my own personal expenses from the total amount.
Do do so, i have to exclude some other items from the selection, even if
payed with my credit card.
The field is a text that starts with the number of my credit card and then
the description of the expenses. Selection criteria is as follow:
Like "67XX XXXX XXXX XX42 *" And Not Like "* supermarket *" And Not Like "*
.... *" and so on. No problem so far.
The trouble starts when I add another criteria in a different field but on
the same row of the previous one.
This new field contains remarks that i manually add to the record when the
description field is not so clear.
For instance, the criteria of remark field is: And not like "* car *".
When I apply the query, access returns an incomplete list of records.
I hope to have given enough info to understand my problem.
Could someone explain me why?
 
D

Douglas J. Steele

It can be difficult to add multiple criteria when you're using the graphical
query builder.

As long as all of your Description field criteria are in the same row,
though, adding

Not Like "* car *"

as the criteria for the Remarks field should work.

The SQL associated with your query should look something like:

WHERE ((Description NOT LIKE "67XX XXXX XXXX XX42 *") AND (Description NOT
LIKE "* supermarket *") AND (Description NOT LIKE "*...*")) AND (Remarks NOT
LIKE "* car *")

(although Access will have far more parentheses than that)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top