Queries, SQL Aggregate Functions, and Criteria

slrphd

Registered User.
Local time
Today, 07:56
Joined
Jan 6, 2004
Messages
91
This ought to be really simple but I must be having a mental block. I want to run a query on a table with a field containing letter codes and I wish to count a only one of the various codes possible. It seems to me that I should be to set up the query using SQL aggregate functions (COUNT) and set the criteria to letter code of interest. When I do that, I get a data type mismatch error. Do I need to use the ASCII value of the letter code? That makes no sense. Help!
 
If the letter code field is a text field, the query in SQL View should be something like this:-

Select Count(*) as CountOfCode
From [TableName]
Where [NameOfLetterCodeField]="theLetterCode"


If the letter code field is a numeric field, just put the letter code number without the quotes.
 
Jon K,
Thanks for your advice. It worked as soon as I dentified the right fields. Slowly, I learn.
Steven Ross
 

Users who are viewing this thread

Back
Top Bottom