CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: SEEK/FIND

  1. #1
    Join Date
    May 2001
    Location
    MO, USA
    Posts
    87

    SEEK/FIND

    i have a database with 3 forms covering different data... i wont to create a main search that will search all 3 tables ta once and return the corresponding search...in a new table with all the info from the table related to the search any ideas, or examples of this.....

    midnightservice
    thanks in advance


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: SEEK/FIND

    Try to use join to search all 3 tables.

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: SEEK/FIND

    You can combine multiple select statements using the UNION keyword. Note that all select statements must return the same amount of columns, and that the datatypes of the columns in the different tables matches.

    SELECT ColumnA, ColumnB, ColumnC
    FROM TabelA
    WHERE ColumnA Like '*VBCodeLibrary*'

    UNION

    SELECT ColumnA, ColumnB, ColumnC
    FROM TabelB
    WHERE ColumnA Like '*VBCodeLibrary*'

    UNION

    SELECT ColumnA, ColumnB, ColumnC
    FROM TabelC
    WHERE ColumnA Like '*VBCodeLibrary*'



    Here I matched them up using the same condition, but you can create a different WHERE clause for each select statement.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured