?
Solved

MS Access query

Posted on 2013-05-29
4
Medium Priority
?
237 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 800 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

777 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