Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL (MS Access) to return values in table similar (to a set % tolerance) to values in another table. 1

Status
Not open for further replies.

NWildblood

Technical User
Nov 12, 2007
113
GB

Hi
I have 2 tables with similar data

TBL1
ROW | CO1 | CO2 | START MILEAGE
1 | ABC | 200 | 123.456
2 | ABC | 200 | 200.005

TBL2
ROW | CO1 | CO2 | START MILEAGE
1 | ABC | 200 | 400.00
2 | ABC | 200 | 125.00

I would be very pleased to know if there is some SQL out there that would return a match against START MILEAGE

- in TBL1 Row 1 and TBL2 Row 2 - because the values fall within a 25% variance

- but not for TBL1 Row 2 and TBL2 Row 1

Any pointers gratefully received !






No hay nada como un buitre cabrón como un ojo de cristal.
 
Code:
From tbl1 t1, tbl2 t2

Where ...
  And t1.[start mileage] between t2.[start mileage]*0.75 and t2.[start mileage] *1.25

Or something similar

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top