Connecting Tech Pros Worldwide Help | Site Map

SQL Count(*)

davy.cox@gmail.com
Guest
 
Posts: n/a
#1: Jul 10 '07
I would like to make an SQL that counts the records resulting from an
other SQL:

This is the Query resulting the records (31 in my test)

SELECT A.customerid FROM A INNER JOIN customers ON A.customerid =
customers.Customerid WHERE Left([PeriodeID],8)='20070625' AND
customers.Companyid=97 GROUP BY A.customerid;


I would like just one record result with the total count of the
records in this query: 31
I tried things like:

SELECT Count(*) FROM (SELECT A.customerid FROM A INNER JOIN customers
ON A.customerid = customers.Customerid WHERE Left([PeriodeID],
8)='20070625' AND customers.Companyid=97 GROUP BY A.customerid;)

But he keeps on giving me an error on the FROM clause

Anyone who can help me, probably supper simple, but I gave up
searching and really can't find it.

Thanks in advance

Yitzak
Guest
 
Posts: n/a
#2: Jul 10 '07

re: SQL Count(*)


On 10 Jul, 16:08, davy....@gmail.com wrote:
Quote:
I would like to make an SQL that counts the records resulting from an
other SQL:
>
This is the Query resulting the records (31 in my test)
>
SELECT A.customerid FROM A INNER JOIN customers ON A.customerid =
customers.Customerid WHERE Left([PeriodeID],8)='20070625' AND
customers.Companyid=97 GROUP BY A.customerid;
>
I would like just one record result with the total count of the
records in this query: 31
I tried things like:
>
SELECT Count(*) FROM (SELECT A.customerid FROM A INNER JOIN customers
ON A.customerid = customers.Customerid WHERE Left([PeriodeID],
8)='20070625' AND customers.Companyid=97 GROUP BY A.customerid;)
>
But he keeps on giving me an error on the FROM clause
>
Anyone who can help me, probably supper simple, but I gave up
searching and really can't find it.
>
Thanks in advance
Shouldn't the semi colon be the last item?

GROUP BY A.customerid;) ---GROUP BY A.customerid);



Bob Quintal
Guest
 
Posts: n/a
#3: Jul 11 '07

re: SQL Count(*)


davy.cox@gmail.com wrote in
news:1184080130.653524.149390@22g2000hsm.googlegro ups.com:
Quote:
I would like to make an SQL that counts the records resulting
from an other SQL:
>
This is the Query resulting the records (31 in my test)
>
SELECT A.customerid FROM A INNER JOIN customers ON
A.customerid = customers.Customerid WHERE
Left([PeriodeID],8)='20070625' AND customers.Companyid=97
GROUP BY A.customerid;
>
>
I would like just one record result with the total count of
the records in this query: 31
I tried things like:
>
SELECT Count(*) FROM (SELECT A.customerid FROM A INNER JOIN
customers ON A.customerid = customers.Customerid WHERE
Left([PeriodeID], 8)='20070625' AND customers.Companyid=97
GROUP BY A.customerid;)
>
But he keeps on giving me an error on the FROM clause
>
Anyone who can help me, probably supper simple, but I gave up
searching and really can't find it.
>
Thanks in advance
>
>
SELECT count(A.customerid)
FROM A
INNER JOIN customers
ON A.customerid = customers.Customerid
WHERE Left([PeriodeID],8)='20070625'
AND
customers.Companyid=97;



--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Closed Thread