Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Selection criteria

Discussion in 'Information Technology' started by PE, Nov 19, 2005.

  1. PE

    PE
    Expand Collapse
    Guest

    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
     
  2. Loading...


  3. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    (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?

    --
    Brendan Reynolds


    "PE" <pitsofearth@msn.com> wrote in message
    news:%23msGLUC7FHA.1032@TK2MSFTNGP11.phx.gbl...
    >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
    >
    >
     
  4. PE

    PE
    Expand Collapse
    Guest

    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.


    "Brendan Reynolds" <brenreyn@discussions.microsoft.com> wrote in message
    news:%237diLfC7FHA.3660@TK2MSFTNGP09.phx.gbl...
    (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?

    --
    Brendan Reynolds


    "PE" <pitsofearth@msn.com> wrote in message
    news:%23msGLUC7FHA.1032@TK2MSFTNGP11.phx.gbl...
    >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
    >
    >
     

Share This Page