Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining fields from multiple tables

Status
Not open for further replies.

accessgoat

Programmer
Jul 23, 2002
15
US
Hi guys!
I have been trying to combine 2 tables with one common field name ID# although some of the values in those field may not be common for both tables. Table 1 contains also Drug1, Drugtiming1. Table 2 contains Drug2 and Drugtiming2 inaddition to the ID#. Can anyone suggest a way to join these tables without duplicating ID#s but also at the same time not losing any data?

Thanks,
accessgoat
 
HI,

You can use a UNION query. As long the # fields and types match which in this case won't be a probllem:

SELECT * FROM table1 UNION SELECT * FROM table2

Have a good one!
BK
 
Hi!

Thanks for the tip. Actually I already tried the Union query but it merges the Drugs 1 and 2 together in one column and the Drugtimings 1 and 2 together in one column whereas i want it to be in separate columns. I have tried different left and right join combinations but no luck.

Accessgoat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top