Include negative amounts in query

accessma

Registered User.
Local time
Today, 08:59
Joined
Sep 17, 2006
Messages
54
Using this query:

Code:
SELECT ApTest.GrossAmt, ApTest.PaidAmt, ApTest.DistAcct, Abs([GrossAmt]) AS Expr1
FROM ApTest
WHERE (((ApTest.GrossAmt) In (SELECT [GrossAmt] FROM [ApTest] As Tmp GROUP BY [GrossAmt] HAVING Count(*)>1 )))
ORDER BY ApTest.GrossAmt;

I can successfully find all the positive GrossAmt duplicate records. However in this case, I want to consider a negative amout as a duplicate as well. I know there are some in my table. How can I go about correcting the query to pull the negative amounts too? Thanks
 
I don't believe
PHP:
SELECT [GrossAmt] FROM [ApTest] As Tmp GROUP BY [GrossAmt] HAVING Count(*)>1 )))
ORDER BY ApTest.GrossAmt
is in proper syntax.

Build that expression correctly in the query builder and then paste it in your query. If a GrossAmt is not repeated, it is not included. Is that what you intend?
 

Users who are viewing this thread

Back
Top Bottom