[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

MS Access query

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
alisonthom
Asked:
alisonthom
  • 2
  • 2
1 Solution
 
SharathData EngineerCommented:
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
 
alisonthomAuthor Commented:
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
 
SharathData EngineerCommented:
Replace PK with the common column in the above sql
0
 
alisonthomAuthor Commented:
Very sorry for the delay in replying.
Thanks so much for your help
Alison
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now