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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a table from combining two unrelated tables 1

Status
Not open for further replies.

scottetombleson

Programmer
Jan 8, 2005
18
US
I need to create a table from the combination of two unrelated table. I have a table of dates and a table of rooms. I need a third table with a record for each combination of room and date. I know there is an easy way to do this, but...... well..... I'm dumb.

Thanks very much for your help!

Scott
 
Create a query that shows all combinations of date and room combinations. Just add both tables to a query, show each fields and because there are no links between the two tables, you will get all records from each tables.
This is called the Cartesian Product of the two tables.

Now, all you have to do is turn this into a make table query. (Query -> Make Table query and enter the table name).
You should really set a primary key and foreign key relationships after it has been run if you will be using this in the future for joins across tables.

John
 
WOW! That was easy and incredibly helpful. Thanks very Much! I appreciate you prompt response.
 
Man, the second Cartesian Product solution I have seen this week.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top