Query to combine 2 tables

L

Leslie Isaacs

Hello All

I need a query that will return a record for every combination of records in
tables [employee] and [training_needs].
E.g. if [employee] has 6 records and [training_needs] has 7 records, my
query must return all 42 combinations.
The trouble is, [employee] and [training_needs] contain no related fields.

In case it helps, I will explain why I (think!) I need this.
In fact I need a table with all the combinations of records - so the above
query will be a make-table query.
Every employee must be 'assessed' for every Training Need: for each Training
Need each employee will be either a '1'or a '2' or a '3'.
So I need a table [employee_training_needs].
I realise I could build this up employee by employee, but as there are in
fact over 200 employees this would be very tedious.

I'm sure it can be done in one go ... but I can't see how to do it!

Hope someone can help.

Many thanks
Les
 
A

Allen Browne

Just create the query with the 2 tables, and without any join.
It gives you every combination.
(This kind of query is called a Cartesian product.)
 
L

Leslie Isaacs

Allen

Blimey - that was easy!!
Somehow I had thought tables had to be joined in a query.

Many thanks for your help.
Les


Allen Browne said:
Just create the query with the 2 tables, and without any join.
It gives you every combination.
(This kind of query is called a Cartesian product.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Leslie Isaacs said:
Hello All

I need a query that will return a record for every combination of records
in tables [employee] and [training_needs].
E.g. if [employee] has 6 records and [training_needs] has 7 records, my
query must return all 42 combinations.
The trouble is, [employee] and [training_needs] contain no related
fields.

In case it helps, I will explain why I (think!) I need this.
In fact I need a table with all the combinations of records - so the
above query will be a make-table query.
Every employee must be 'assessed' for every Training Need: for each
Training Need each employee will be either a '1'or a '2' or a '3'.
So I need a table [employee_training_needs].
I realise I could build this up employee by employee, but as there are in
fact over 200 employees this would be very tedious.

I'm sure it can be done in one go ... but I can't see how to do it!

Hope someone can help.

Many thanks
Les
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top