Make table query

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

Guest

Hello

I have 2 tables that I'm trying to make a new table from with a make table
query.
Ok that's the easy part out of the way.

Basically table 1 has start and end point fields and table 2 has start and
end point fields that are segments of table 1's start and end point fields
(hope that's clear).

Table 1 has a mileage from field, a mileage to field and a category field.
Table 2 has a mileage from field and a mileage to field.

The make table query should say if table 2's start and end points fall
within table 1's start and end points then copy that record along with the
category field to the new table.
 
A Select query for this would probably look something like the following.

SELECT Table1.Category, Table2.Start, Table2.End
FROM Table2 INNER JOIN Table1
ON Table2.Start <=Table1.End AND
Table2.End >= Table1.Start

If that gives you the desired results, then you should be able to use that
as the basis for the MakeTable query
SELECT Table1.Category, Table2.Start, Table2.End INTO MyNewTable
FROM Table2 INNER JOIN Table1
ON Table2.Start <=Table1.End AND
Table2.End >= Table1.Start

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top