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

HAVING Clause problem

Status
Not open for further replies.

BruceG

Programmer
Dec 9, 2001
31
US
I've got a puzzler here. I have two MAS tables connected to Access 2000 thru the ODBC driver. In the SQL query window, I have the following:

SELECT CustomerNumber, COUNT(*)
FROM AR4_OpenInvoice
GROUP BY CustomerNumber
HAVING COUNT(*) > 10

The problem? The query runs but produces no records.
I take the HAVING clause off, and it runs - I see the CustomerNumber, along with the counts (many of which are > 10)!

Is there some kind of bug in the driver or some issue where the HAVING clause does not work as expected? I tried a similar query using the Northwind sample database and it worked fine. (I did the following):
SELECT OrderID, COUNT(*)
FROM [Order Details]
GROUP BY OrderID
HAVING COUNT(*) > 2

Any ideas? TIA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top