Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Access query follow up to question that was answered

Avatar of tfkcon
tfkcon asked on
Microsoft Access
7 Comments1 Solution655 ViewsLast Modified:
Here is the questions:
I have an Access db with a sample file containing invoices paid.  
I need to write a report that groups payment of equal amounts (Use GrossAmt) for each vendor together.

Ignore the sign (positive or negative) of the amount. Ignore groups with only one record.
For each vendor show a group header containing the vendor number and name.

For example if the GrossAmt is $100 in one record and the GrossAmt is $-100 in another record treat that as a match.

Here is the answer that I wanted some clarification on the sql:
SELECT ApTest.VenNum, Abs(ApTest.GrossAmt) AS [Gross Amount Duplicate], ApVenTest.VenName, ApTest.InvNum AS InvNum, ApTest.DueDte, ApTest.PaidDte
FROM ApTest INNER JOIN ApVenTest ON ApTest.VenNum = ApVenTest.VenNum
GROUP BY ApTest.VenNum, ApTest.GrossAmt, ApVenTest.VenName, ApTest.InvNum, ApTest.DueDte, ApTest.PaidDte
HAVING (((ApTest.VenNum) In (SELECT [VenNum] FROM [ApTest] As Tmp GROUP BY [VenNum], Abs([GrossAmt]) HAVING Count(*)>1  And Abs([GrossAmt]) = Abs([ApTest].[GrossAmt]))))
ORDER BY ApTest.VenNum, Abs(ApTest.GrossAmt);
Avatar of Rey Obrero (Capricorn1)
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answers