A beginner here......
I have 2 tables that have unique records. I'm wondering if it's possible to pull all the records from one and select records from another into a single query?
Semper Fi,
Sarge
A beginner here......
I have 2 tables that have unique records. I'm wondering if it's possible to pull all the records from one and select records from another into a single query?
Semper Fi,
Sarge
Probably, but it would help to see an example of what the data in each looks like and the result you want to see. The solution could involve a join or a UNION query depending on that.
From your PM (questions and answers should stay on the thread so others can benefit):
I'm trying to build a db for use with a sports club. We have kids that want to play indoors and outdoors, and kids who want to play indoors only. I have separate tables for the registration data for both, with associated forms. This is because the registration data comes to me from 2 directions. One is an online system, which would be an import, and the other is manual data entry into the appropriate table.
I have to provide a roster of all the kids that want to play indoors, so I have to pull all the records from the table of indoors only players and only the records of the kids that want to play indoors from the table of those that want to do both.
Ya with me so far?
The structure of each table is different, as the one for the indoors only players does not have as many fields of data per record as the other one.
There are no common records between the 2 tables.
If I can get all the pertinent records from both tables into a query, I can create a form with only the fields I need for the roster and export it to Excel. Obviously I could do it manually, but if there's a way to do it so manual manipulation of the data isn't resuired, that would be the way to go.
- Sarge
I was thinking more of a visual of the data, but with no field to link on (which I assume is what you mean by "no common records"), you probably want a UNION query:
SELECT Field1, Field2, Field3
FROM Table1
UNION ALL
SELECT Field1, Field2, Field3
FROM Table2
The number of fields in each SELECT clause must match, and as you might guess they should be compatible types. If one table has more fields, you can use things like
SELECT Field1, 0 AS Field2, "None" AS Field3