Eliminate opposite values

hobbes

Registered User.
Local time
Today, 02:34
Joined
Feb 13, 2004
Messages
30
Hi,
I have a query that narrows my records between specific date ranges. I also need this query (or another query if I need to write one) to eliminate the records that are opposite each other from the results of the first query. For example:

ID Name Act Number
1 ABC buy 12345.67
1 ABC sell -12345.67

I want to eliminate both of these from my final results. I tried implementing the ABS function on the number field, but it just removed the numbers with a negative sign from my results. I need to make sure that the only records that are eliminated are the ones with matching opposite values (like the ones in the example). If it doesn't have an opposite match, I need it in my final results.

Thanks for the help!
Hobbes
 
You can create two queries, one for Buy records only and one for Sell records only, then create a third Unmatched query comparing the Buy and Sell queries, that should be the final result set.

Note if you can have both and unmatched Busy and an unmatched Sells, you will need two Unmatched queries (One showing unmatched buys and one showing unmatched sells) that are joined in a Union Query
 

Users who are viewing this thread

Back
Top Bottom