Is it possible to use GROUP BY value HAVING (a par

# Thread: Is it possible to use GROUP BY value HAVING (a par

1. Junior Member
Join Date
Dec 1969
Posts
10

## Is it possible to use GROUP BY value HAVING (a par

Hi!<BR><BR>I recently got som help solving my problem with "GROUP BY" here at this forum. However I now have another problem. I want to select all orderdates from the orders table and count all orders with similar dates and group them together. This is done with my code below:<BR><BR>sqlq = "SELECT colOrderDate, COUNT(colProductsOrdered) AS NoOfOrders " _<BR>& " FROM tblOrders " _<BR>& " GROUP BY colOrderDate " _<BR>& " ORDER BY colOrderDate ASC"<BR><BR>This produces a list similar to this:<BR><BR>NoOrders Date<BR>4 15/03/2004<BR>6 14/03/2004<BR>3 13/03/2004<BR>1 19/02/2004<BR>2 11/02/2004<BR>3 13/01/2004<BR><BR>The problem is that that I&#039;m not really interested in how many orders there are each day, (the list would grow too large). I want to know how many orders there are each month and group them together! Is it possible to use GROUP BY colOrderDate HAVING....? And then somehow just using a wildcard for the days, matching the month and grouping it?<BR><BR>I want to produce a list that looks like this:<BR>NoOrders Date<BR>13 03/2004<BR>3 02/2004<BR>3 01/2004<BR><BR>Hope someone can tell me how to figure this out?

2. Senior Member
Join Date
Dec 1969
Posts
16,931

## RE: Is it possible to use GROUP BY value HAVING (a

We do something similar for statistical analysis of our applications.<BR><BR>What database are you using? SQL Server?<BR><BR>Craig.

3. Junior Member
Join Date
Dec 1969
Posts
10

## RE: Is it possible to use GROUP BY value HAVING (a

Well, right now it is Access, but when the application is finished I guess I&#039;ll use MSSQL. Right now I&#039;m using an ADO connection.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•