View Full Version : Getting a count


MEMYSELFI
05-09-2002, 09:53 AM
I need to get a count of children who are linked to mother ID and are NOT in a particular group...
I can do the condition but how do I set up the count?

BLeslie88
05-09-2002, 10:24 AM
You need to build it off a query or table where the names will be in order... If any of the names are the same you may have a problem, this won't be a problem if you have an ID for each child....

SELECT Count(*) AS Count, [qryBullet].[Store]
FROM qryBullet AS Temp2, qryBullet
WHERE (((Temp2.Store)>[qryBullet].[Store]-1))
GROUP BY [qryBullet].[Store]
Order By [qryBullet].[Store] Desc;

Good Luck,
Regards...

The_Doc_Man
05-09-2002, 10:26 AM
If you can write the query in the query grid, you have it all but licked.

Copy the query. (Copy & paste works fine for this purpose.) For the new name, if the query was ShowMeX then the new one will be ShowMeCountX.

Now open ShowMeCountX in design mode. In the iconic toolbar above the query grid, click the button that looks like the Greek letter Sigma. (Looks like an M lying on its side.)

Another row will become visible in the grid. You can click the drop-down from one of those rows to become Count.

The other items, you can just uncheck the SHOW box and leave them as criteria. The extra row will mark them as "WHERE" items. Which is what they should be.