Simple ACCESS expression

  • Thread starter Thread starter Dot Appleman
  • Start date Start date
D

Dot Appleman

This is so elemental it's painful.

In a table with field called CYCLE and one called PW, the
possibilities are A, B, C, D, E for CYCLE
I0, P0, and Y for PW. I want to count the number of Y's for
Cycle A, for Cycle E, etc. ditto for the other PW
possibilities.

My questions:
1 - how to do each in a select query,
2 - how to do it in a report with CYCLE + PW as the
grouping levels, and
3 - can I use another query as the basis for the select
query in which to count? The directions in various ACCESS
books create the query to count from tables.

Thanks a lot,
Dot
 
Dot said:
This is so elemental it's painful.

In a table with field called CYCLE and one called PW, the
possibilities are A, B, C, D, E for CYCLE
I0, P0, and Y for PW. I want to count the number of Y's for
Cycle A, for Cycle E, etc. ditto for the other PW
possibilities.

There are many ways of doing what you want. I suggest using a select
query with a count function. You can base your report on a query.

My questions:
1 - how to do each in a select query,

Do a where for each field to get what you want and then count one of
those fields.
 
You could play around with the crosstab query wizard and see if it generates
what you're looking for.
 
Dot Appleman said:
This is so elemental it's painful.

In a table with field called CYCLE and one called PW, the
possibilities are A, B, C, D, E for CYCLE
I0, P0, and Y for PW. I want to count the number of Y's for
Cycle A, for Cycle E, etc. ditto for the other PW
possibilities.

My questions:
1 - how to do each in a select query,

If I understand what you want, try this (replaceing "YoutTable" with the
name of the table):

SELECT Cycle, PW, Count(*) As TheCount
FROM YourTable
GROUP BY Cycle, PW;
2 - how to do it in a report with CYCLE + PW as the
grouping levels, and

Add a text box in the group footer section of the PW group, with a
controlsource of

=Count(*)
3 - can I use another query as the basis for the select
query in which to count? The directions in various ACCESS
books create the query to count from tables.

I'm not sure I understand this question.
 

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

Back
Top