relationship?

  • Thread starter Thread starter Matthew
  • Start date Start date
M

Matthew

I have a field in one table called "Quantity" which
contains an order quantity. I have a field in a second
table called "Quantity Range" which contains various
quantities within a price point. (i.e below)

Quantity(in table 1) Quantity Range(table 2)
50 24 - 71

question is if i can relate "Quantity" and "Quantity
Range" in a query. So if quantity lies within quantity
range then show the record. Your help is greatly
appreciated. thanks.

Matthew.
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The table Quantity Range needs the low and high values in separate
columns. Then you can use the BETWEEN comparison expression to get the
related row(s) from table Quantity. E.g.:

SELECT <whatever columns you want from the tables - usually just
Quantity>
FROM Quantity As Q INNER JOIN [Quantity Range] As QR
ON Q.OrderQuantity BETWEEN QR.Low AND QR.High

This query will return all records from table Quantity that have
OrderQuantity's in ALL the ranges in the Quantity Range table.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQQqE14echKqOuFEgEQKO0QCfWyQt4ryAYYD2tA6y3pkASHc2rJEAoLm+
TC2ss7vtnwiNfd8kqoA3qlAC
=xtaX
-----END PGP SIGNATURE-----
 
Back
Top