Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MS Access 2007 JOIN on Multiple Fields

Tags:

join

ms-access

I have a two tables similar to the following:

enter image description here

enter image description here

I am attempting to create a query in Access to create a table like this:

enter image description here

The crux of course is that the JOIN must match against both the Date and Name fields. I can join the fields from T2 into T1.

What is the proper syntax (either in SQL or via the query designer) to join the fields on both Date and Name?

My attempts have duplicated the field count.

like image 655
Jason Strimpel Avatar asked May 30 '12 16:05

Jason Strimpel


1 Answers

Using the query design window, drag Date from T1 to match Date in T2 and similarly, drag Name from T1 to T2. This will give you an INNER JOIN on bioth name and date. Switch to SQL view to view the SQL.

BTW, both Name and Date are reserved words. Name in particular is a terrible thing to call anything in MS Access, so I hope these are imaginary field (column) names.

like image 108
Fionnuala Avatar answered Dec 11 '22 08:12

Fionnuala