|
-
May 27th, 2001, 04:48 PM
#1
Thread Starter
Junior Member
Access question
Hi there, this is a question concerning merging 2 tables in Access.
I have 2 tables with a common field "timestamp".
Table 1 has timestamp, field 1, field 2.
Table 2 has timestamp, field A, field B (for example).
New table will have timestamp, field 1, field 2, field A, field B and the records will be made from records in the 2 original tables with common timestamp values.
How do I do that?
Thanks!!
-
May 27th, 2001, 05:45 PM
#2
Try something like this:
Select field1, field2, FieldA, FieldB From Table1, Table2 Where Table1.TimeStamp = Table2.TimeStamp
-
May 27th, 2001, 05:45 PM
#3
Member
Reply
The sort of thing that u have to do is a create a query and add both tables and all the fields from both tables and that should work (Note: do not query anything)
What is Life? One big dream or one Big nightmere.
-
May 27th, 2001, 05:46 PM
#4
PowerPoster
If I am understanind you right, you want to do the following
Table 1 data
----------------
"Hello", "World", "Hi"
"Isn't", "She", "Lovely"
Table 2 data
----------------
"I've", "Got", "A"
"Lovely", "bunch","Of"
"Coconuts","he","he"
and combine the two to form
Table 3 Data
----------------
"Hello", "World", "Hi"
"Isn't", "She", "Lovely"
"I've", "Got", "A"
"Lovely", "bunch","Of"
"Coconuts","he","he"
Is that right? To do that you need to use a UNION query. This is the syntax:
Code:
SELECT Table1.Field1, Table1.Field2, Table1.Field3 FROM Table1
UNION ALL SELECT Table2.Field1, Table2.Field2, Table2.Field3 FROM Table2;
Hope that helps!
-
May 27th, 2001, 07:14 PM
#5
Thread Starter
Junior Member
Thanks, that worked fine, I used:
select table1.*, table2.* from table1, table2 where table1.date/time = table2.date/time
Then I turned it into a "Make Table Query" to make my new table.
Nice one!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|