Select on multiple tables based on "IDs" from the first table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siilexx
    New Member
    • Aug 2010
    • 19

    Select on multiple tables based on "IDs" from the first table

    Hello,

    I'm trying to build a query that will search information on a few tables at once, in an Access database.

    I must SELECT all records from a "Table1", then a few columns from "Table2" using a "WHERE Table2.ID=Table 1.IDClient".

    What's the best way of working (Multiple select, JOIN or else) ?

    Thank you
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Use a join.

    Comment

    • siilexx
      New Member
      • Aug 2010
      • 19

      #3
      The following query is working:
      myQuery = "SELECT Bail.*, Client.ID, Client.NoClient , Client.Label, Client.Adresse, Client.CP, Client.Commune, ClientBail.* FROM ((Bail LEFT OUTER JOIN Client ON Bail.IDClient=C lient.ID) LEFT OUTER JOIN ClientBail ON Bail.IDClientBa il=ClientBail.I D) ";

      Thank you

      Comment

      Working...