Creating a query to find differences

biofaku

Member
Local time
Today, 12:33
Joined
May 15, 2020
Messages
72
Hi, I'm trying to create a query that allows me to find the differences between values inside a same table.
Let's suppose I have this table:
ClientItem
A1
A2
A3
B1
B2
B4

The query should return only these results:
ClientItem
A3
B4

I tried using WHERE NOT IN, but so far it did not work.
Any idea how to achieve this?

Thanks!
 
I don't understand your words, but do understand your example. "Difference" implies subtraction, but that's not what you want based on your example. What you want is to return the highest value in item for each Client. that can be done with a simple aggregate query:


Specifically you want to use the MAX function:


I would read through that entire tutorial.
 
Hi plog, thanks for your input. I'm sorry if I have not expressed myself well, and I think the example was confusing because I used numbers on the column Item. What I'm trying to do is a query that gets the values on the column Item that are not in common with the Client column. The value on any of both columns could be a number, a date, a letter.
In this example, both the numbers 1 and 2 are found either on the client A or the client B, but that doesn't happen with the item 3 or the item 4.

I think if EXCEPT on SQL worked on access, the solution would be query using that statement
 
Words aren't working. Please provide sample data to demonstrate what you want.
 
Thanks everyone for the input!
bastanu that worked perfectly! Thanks a lot!
 

Users who are viewing this thread

Back
Top Bottom