Help with queries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shreeks
    New Member
    • Jan 2009
    • 10

    Help with queries

    Hi,
    I am very much new working on Access database. I have 2 tables,

    My first table is like
    No's colors made
    1 blue nissan
    2 red corolla

    My second table is like
    No's colors car
    1 blue sentra
    1 red altima
    1 green maxima
    2 blue corolla
    2 red camry

    I now want my output table to be

    No's colors made car
    1 blue nissan sentra
    2 red corolla camry
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    #2
    There seems to be no relationship between your tables. What is the basis for your output?

    Comment

    • shreeks
      New Member
      • Jan 2009
      • 10

      #3
      I need to have the No's and colors coloums from my first table... here the No's columns is set as a primary key.... I need my new table with first 3 columns of the first table as it is and my fourth column of the new table should be from my second table, with only those fields that are present from the No's and colors column of the first table...

      for example...
      my first table has No's 1 and color blue
      and my second table has only one record with No's 1 and color blue.... and it has got sentra as the car...
      so for each corrosponding No's and colors from the first table... i need to extract car from my second table.......

      Comment

      • ChipR
        Recognized Expert Top Contributor
        • Jul 2008
        • 1289

        #4
        In that case,
        1. Go to query design
        2. Add both tables
        3. Drag the number field from table 1 to the number field in table 2 to create the link that says they have to be equal.
        4. Drag the colors field from table 1 to the colors field on table 2.
        5. Double click all the fields in table 1 to add them to the resulting query.
        6. Double click the car field in table 2 to add to the result.
        7. And execute.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #5
          I must warn you that your table design is almost certainly going to cause you problems in future (unless your project is extremely limited in scope).

          Please check out theis very helpful article (Normalisation and Table structures). If you plan to proceed with any kind of database work this is essential reading.

          Comment

          Working...