Link to home
Start Free TrialLog in
Avatar of Bear2
Bear2

asked on

Matching query in Access

Hi,
I need some help with a matching query in Access:

I have 2 tables: TableA and TableB which are not connected in the database. In TableA I have a column
ColumnA and want to find the closest values in ColumnB in Table B (not exact match).

I want the result of the query to display all values in ColumnA in one column and the closest values to each value in ColumnA in ColumnB in another column.

Thanks in advance!

   

Avatar of Sham Haque
Sham Haque
Flag of United Kingdom of Great Britain and Northern Ireland image

this would be easier to achieve in Excel, with a VLOOKUP call, and the final argument of TRUE to indicate an approximate match....
what are the data type of the columns ?
define closest match...?

give an example of the data and what you'd expect...


have you considered

select a.column,max(b.column)
 from tablea as a
 left outer join tableb as b
 on a.column > b.column
 group by a.column
 order by 1
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bear2
Bear2

ASKER

Perfect solution
Thanks!

/gustav
I'm looking for good examples for use of this method.

Would you mind telling me what this solution solved for you? Just the headline, no detailed data is needed.

/gustav
Avatar of Bear2

ASKER

Very simple. If you have created a table with input values and want to compare them with a table with standard values this solution helps with the grouping.

Thanks again Gustav!
Very good, just what I needed. Thanks!

/gustav