Selection criteria

  • Thread starter Thread starter PE
  • Start date Start date
P

PE

I have created a query and would like to select records based on the
following criteria:

Select all records where the field has "holiday" or "vacation" but exclude
those which have "public holiday".

Is it possible to put the criteria on one line or would I have to use two
lines -
Like "Holiday*" And Not Like "Public Holiday*"
Like "vacation*"

Al
 
(Like "Holiday*" And Not Like "Public Holiday*") Or Like "vacation*"

Access may well change that to two criteria rows the next time you open it
in design view, though. The query designer does that sometimes, and as far
as I know there isn't any way to stop it, short of never opening the query
in design view.

I'm not sure that it really makes any difference in this scenario, though?
 
Yes Access does change the criteria to two row.

The problem I had with two rows was that I had to key in dates to and from
(to select records between certain dates) twice, but after doing what you
suggested I only have to key in the dates once, even though Access has split
the criteria to two rows!!

Thanks for your help.


(Like "Holiday*" And Not Like "Public Holiday*") Or Like "vacation*"

Access may well change that to two criteria rows the next time you open it
in design view, though. The query designer does that sometimes, and as far
as I know there isn't any way to stop it, short of never opening the query
in design view.

I'm not sure that it really makes any difference in this scenario, though?
 

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

Back
Top