Question Hot to get information from 2 tables to make a third?

torcator

New member
Local time
Today, 01:29
Joined
Jan 29, 2012
Messages
1
Hey guys,
I'm new at this forum and also I'm new at access, but I am an experimented excel user. The reason I come to your world if because I cant do this in a easy way in excel.

Basically I have 2 tables with different information but in both I have 2 unique field, one is an 10 numbers id and the other is the date.

I need a third table to get the date, the id and get all the fields from both tables, do you how can I do this?

By the way I'm using access 2010.
thanks a lot...
 
You can't just use a query? It actually needs to be a table? If so, then I believe that is what the make table queries do. I've never needed to use one, so I'm not quite sure.
 
You might find this link useful www w3schools.com/sql/sql_union.asp (I omitted the '.' between www and w3schools because I'm not allowed to paste links as a newbie to the site).
Have a look at the SQL UNION query.
If your tables have different field names, you can do something like this:
SELECT t1ID AS uID, t1Date AS uDate FROM table_name1
UNION
SELECT t2ID AS uID, t2Date AS uDate FROM table_name2
and you could add
ORDER BY uDate
From the resultant query output, you could use the key to retrieve other fields using the relevant key (bearing in mind that the keys for each table are indistinguishable from the fieldname uID).
You mention doing this in Excel - do you mean in VBA or in a cell query? I have not tried the latter with this construct, but no reason it shouldn't work (I think!).
Nick H
 

Users who are viewing this thread

Back
Top Bottom