Frontpage SQL Query

J

jim-c BEC

I have a database with a table called "listing" The fields I'm trying to
work with are 'Year', and 'Description'

The result I am looking for is a 3 column table showing the Year, the count
of records for that year, and the count of records matching a specific
description for each year:

I.E.
Year Total Records Matches

1960 10 2
1961 20 0
1962 6 5

I have been able to get the first two columns with the query below, but
cannot figure how to get the third column which would show how many of the
years total match the description I want. For example how many records of
the total for a year have the description "Completed"

SELECT DISTINCTROW Listing.Year, Count(*) AS [Count Of Listing]
FROM Listing
GROUP BY Listing.Year;

Any help would be appreciated.

Jim Clavin
 
M

MD Websunlimited

Hi Jim,

You'll need to utilize a sub query within the main query to accomplish.
 
M

MikeR

Jim -
I can do it in 2 queries, but not one. If you don't get an answer here, try
microsoft.public.access.queries.
Good luck.
MikeR 1st
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top