Not related table query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Access 2003

I think I know the answer, but I thought I would ask. I have inherited an
Access database that has two non-related tables. Let's say both of these
tables track Tour information. Table A tracks Group Tours while Table B
Tracks School Tours. Both tables have the same fields; an ID field
(autonumber), a Total Attended field (number) and a Tour Date field (date).

My question is, whether there is a way to create a query that will give me a
sum of the Total Attended fields from both tables based on a specified date
range?

Thanks for considering this question.
 
Probably, but it seems like you should normalize the data first. Combine
all the entries into ONE table. You would need to first add a "Type" field.
Populate all the records in the first table with "Tour" and all the records
in the second table with "School". Then use an append query to copy all the
records from one table to the other, then delete the table from which you
copied records.

Of course, you'll have to change your queries, forms, and reports to use the
appropriate table and to limit records based on type.
 
And if you can't or don't want to change your table structure, you can
combine the two tables in a union query so they look like one. The union
query might be something like:

SELECT *
FROM tblA
UNION ALL
SELECT *
FROM tblB;
 
Back
Top