Last post Aug 20, 2008 12:23 PM by Mikesdotnetting
Aug 20, 2008 10:09 AM|jimbo101974|LINK
I am building an application and have need to see how many times a certain string appears in a certain column. I am having difficulty constructing my select statement. In the example below I am simply trying to list each Instructor and the number of times
they are signed up.
Select INSTRUCTOR, Count(*) As Count FROM TRAINING GROUP BY INSTRUCTOR
Aug 20, 2008 11:12 AM|R-Tuur|LINK
I think the problem is that you are using the reserved word "count" as a fieldname. Try changing your statement to:
Select INSTRUCTOR, Count(*) As Counter FROM TRAINING GROUP BY INSTRUCTOR
Hope this helps you
access 2003 count reserved word
Aug 20, 2008 11:30 AM|jimbo101974|LINK
Hmm... That is exactly what the debug said.
The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect
I tried changing the second count to counter with no success. can you possibly break it down generically for me for example.
Select column, count(*) As count from tablename GROUP BY column
Aug 20, 2008 11:44 AM|R-Tuur|LINK
Just tried it in Access myself. You can't do count(*), but just specify the name of a field in your table will work.
SELECT Training.Instructor, Count(class)
GROUP BY Instructor
Aug 20, 2008 12:23 PM|Mikesdotnetting|LINK
I tried changing the second count to counter with no success
COUNTER is also a reserved word... Try Select COUNT(*) AS TheCount From......