report design question

L

Leo

Hi,
I have a problem creation a form for a cat show.
I have a table with breeds and colors.
I want to print a report for each breed which has 3 or more times the same
color.
Lets say I have:
Persian Red
Persian Red
--> no report
Persian Black
Persian Black
Persian Black
--> one report with Persian and Black on it.
Access is version 2.0 (the database was written 10 years ago :)
Thanks for any help....
Leo
 
D

Douglas J. Steele

Create a Totals query that returns only those rows that meet your criteria.

The SQL for such as query would be something like:

SELECT DISTINCT Breed, Colour
FROM MyTable
GROUP BY Breed, Colour
HAVING Count(*) >= 3

If you're not familiar with working directly with the SQL, create a new
query and select your your table. Add the two fields to the grid, then
convert the query into a Totals query (click on the Sigma icon on the button
bar, or select Totals from the View menu). Add a 3rd column by typing
Count(*) as the field, change the entry on the Total line from Group By to
Expression, and put >= 3 as the Criteria for that new column.

If you require additional fields for your report, join the existing
recordsource of your report to that query you just created.
 

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