count query

E

Edward

Hi everybody,
I have a table that keeps information for different class sessions, we have
only three instructors and I want to generate a report to show number of
classes for each instructor in a date range. I used a query and selected
instructor field from class table then in grouped by i used count and in
criteria i enetered Like "ABC" but although i have intructor "ABC" query
doenst show anything? any thoughts?
 
J

John W. Vinson

Hi everybody,
I have a table that keeps information for different class sessions, we have
only three instructors and I want to generate a report to show number of
classes for each instructor in a date range. I used a query and selected
instructor field from class table then in grouped by i used count and in
criteria i enetered Like "ABC" but although i have intructor "ABC" query
doenst show anything? any thoughts?

That depends, of course, on the structure of your data and the nature of the
query - which we cannot see.

Some thoughts: LIKE uses wildcards, and if you don't include a wildcard such
as * (match any string of characters) or ? (match any single character), it's
exactly the same as the = operator: LIKE "ABC" will match a text value of
exactly ABC, and nothing else. LIKE "ABC*" will match ABC, ABCD, ABCDARIEANIST
or the like <sorry>.

Or, if the field you're searching is a Lookup Field, you're another victim of
Microsoft's misdesigned, misleading misfeature: a lookup field is actually a
number, concealed behind a combo box.

If you'ld post some description of your table (fieldnames, datatypes, content)
and the SQL view of your query we might be able to help.
 
J

John Spencer (MVP)

I suspect that you did not correctly design the query.

To build the query
-- Select Your table
-- Add the Instructor field Three times
-- Add the Date Field (once)
-- Select View: Totals from the menu
-- Change GROUP BY to WHERE under the first of the instructor fields
-- Enter Like "ABC*" in the criteria under the WHERE
-- Change GROUP BY to WHERE under the Date Field and enter the date range criteria
-- Change GROUP BY to Count under the Third instructor field


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

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