'Data type mismatch in criteria expression' error in Count query

A

Al

Hi,
I'm new to Access so be gentle with me ;-) I'm currently doing a project
where I need to count the number of cities (in a 'City' field) which meet
particular city names. I've done a count query with the city name in the
criteria, but all I get is an error saying 'Data type mismatch in criteria
expression'. I'm not sure what I'm doing wrong as the City field is text and
I'm typing the city name correctly.
Any help would be appreciated.
Thanks
Al
 
J

John Spencer

AS a WILD GUESS, you are typing the City name under the field you are
counting. Counts are numbers, cities are strings.

Remove the criteria under the count
Add the City field to the query AGAIN
Change GROUP BY to WHERE
Enter the city criteria under this copy of the city field.

It would help if you posted the SQL statement that you are attempting to
use. To do so, switch from DESIGN view to SQL view (Menu: View: SQL)
and copy the SQL statement and post it to the forum.

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

Al

Thanks very much John. That was the answer I needed. I thought it would be
simple, it was just a matter of finding the answer.

Thanks to all who responded.
Cheers
Al

PS. sorry for the double post. I keep getting a 'Service Temporarily
Unavailable' error which caused it.
 

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