Welcome to SPN

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

Sign Up Now!

Searching across three fields

Discussion in 'Information Technology' started by Jurrasicway, Jul 28, 2006.

  1. Jurrasicway

    Jurrasicway
    Expand Collapse
    Guest

    How do I search across three fields for a name that can occur in any
    recordset? I have created a query that shows the data in 300 records I wish
    to search. The fields I wish to match instances of the names are:

    [GeneralManager], [Cashier1] and [Cashier2].

    I would like to type in a name and locate the match for any of the three
    fields.

    Graeme.
     
  2. Loading...

    Similar Threads Forum Date
    World War 1 Sikh-Canadian Pioneers: Still Searching for Our Sikh War Heroes History of Sikhism Feb 20, 2011
    Sikh News US to begin searching Sikh turbans (Bangkok Post) Breaking News Sep 3, 2007
    Sikh News Sikh community condemns policy on searching turbans (Oakland Tribune) Breaking News Aug 29, 2007
    Searching for an answer Spiritual Articles Mar 22, 2006
    Soul-searching Doctors Find Life After Death Interfaith Dialogues Nov 15, 2004

  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Your WHERE clause would need to be something like:

    WHERE [GeneralManager] = [Name To Match]
    OR [Cashier1] = [Name To Match]
    OR [Cashier2] = [Name To Match]

    If you'd like to be able to type in part of the name and have it do a match,
    you can use


    WHERE [GeneralManager] LIKE "*" & [Name To Match] & "*"
    OR [Cashier1 LIKE "*" & [Name To Match] & "*"
    OR [Cashier2] LIKE "*" & [Name To Match] & "*"



    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Jurrasicway" <Jurrasicway@discussions.microsoft.com> wrote in message
    news:9B6F6A21-D614-417C-B764-043638E691D0@microsoft.com...
    > How do I search across three fields for a name that can occur in any
    > recordset? I have created a query that shows the data in 300 records I

    wish
    > to search. The fields I wish to match instances of the names are:
    >
    > [GeneralManager], [Cashier1] and [Cashier2].
    >
    > I would like to type in a name and locate the match for any of the three
    > fields.
    >
    > Graeme.
     
  4. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    Using a query with "Or" between the criteria

    Select * From TableName
    Where [GeneralManager] = [Please enter name] Or [Cashier1] = [Please enter
    name] Or [Cashier2] = [Please enter name]

    The query will prompt the user to enter a name to search for

    To match a partial match use "Like" instead of "="

    Select * From TableName
    Where [GeneralManager] Like "*" & [Please enter name] & "*" Or [Cashier1]
    Like "*" & [Please enter name] & "*" Or [Cashier2] Like "*" & [Please enter
    name] & "*"

    --
    Good Luck
    BS"D


    "Jurrasicway" wrote:

    > How do I search across three fields for a name that can occur in any
    > recordset? I have created a query that shows the data in 300 records I wish
    > to search. The fields I wish to match instances of the names are:
    >
    > [GeneralManager], [Cashier1] and [Cashier2].
    >
    > I would like to type in a name and locate the match for any of the three
    > fields.
    >
    > Graeme.
     
  5. KARL DEWEY

    KARL DEWEY
    Expand Collapse
    Guest

    Open your query in desugn view and enter this as criteria for
    [GeneralManager] --
    Like"*"& [Enter name] & "*"
    Highlight the criteria and copy. Go down on row and paste as criteria for
    [Cashier1] and down another row to paste for [Cashier2].

    "Jurrasicway" wrote:

    > How do I search across three fields for a name that can occur in any
    > recordset? I have created a query that shows the data in 300 records I wish
    > to search. The fields I wish to match instances of the names are:
    >
    > [GeneralManager], [Cashier1] and [Cashier2].
    >
    > I would like to type in a name and locate the match for any of the three
    > fields.
    >
    > Graeme.
     

Share This Page