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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare one record to many others

Status
Not open for further replies.

TSO456

Technical User
Jul 23, 2001
57
0
0
US
Hi

I have an access table with 2 columns. I would like to compare each record in column one to all the records in column two. If any record in column one is less than column two then produce a report with the records that meet the criteria.

Thank you
Jill
 
Something like this ?
SELECT DISTINCT A.Col1, A.Col2
FROM myTable A INNER JOIN myTable B ON A.Col1 < B.Col2;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PH

I need a VBA code that does that. A SQL query will not work.

Thank you
Jill
 
A SQL query will not work
??? Why ???

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top