Solved

MS Access query

Posted on 2013-05-29
4
234 Views
Last Modified: 2013-05-31
Hi,

I would be very grateful if someone could help me with the following.

I have 2 tables that have the same number of records and some fields are the same.

I would like to produce a query that retrieves all the data from the 2nd table and adds the records for 2 fields from the 1st table.

Many thanks in advance
Alison
0
Comment
Question by:alisonthom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 41

Accepted Solution

by:
Sharath earned 200 total points
ID: 39205837
Do you have a common column on which you can join two tables? You may need something like this.


SELECT Table2.*,Table1.Column1,Table1.Column2
  FROM (Table2
  INNER JOIN Table1 ON Table2.PK = Table1.PK)
0
 

Author Comment

by:alisonthom
ID: 39205923
Thank you for the quick response.

Yes, there is a common column in both tables.  Could you indicate how this would affect the SQL you have suggested?

Many thanks
Alison
0
 
LVL 41

Expert Comment

by:Sharath
ID: 39206153
Replace PK with the common column in the above sql
0
 

Author Closing Comment

by:alisonthom
ID: 39210506
Very sorry for the delay in replying.
Thanks so much for your help
Alison
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question