[AccessD] Counting Co IDs

Arthur Fuller fuller.artful at gmail.com
Mon Nov 5 09:31:45 CST 2007


Not that you need it in this case, but it's worth mentioning a seldom-used
flavor of the Count() syntax. Here's one that works against the
AdventureWorks sample database:

Select Count(Distinct CustomerID) from Sales.SalesOrderHeader

A.

On 11/5/07, Bob Heygood <bheygood at abestsystems.com> wrote:
>
> Well thanks to the Friday morning Access users and beach watchers in SD we
> came up with a solution. More accurately, Mike Dwyer whipped it out on a
> napkin. Here goes:
>
> SELECT a.jid, a.q1, Count(*) AS NumCompanies
> FROM [select distinct jid,q1,coid from responses where q1 is not null]. AS
> a
> GROUP BY a.jid, a.q1;
>



More information about the AccessD mailing list