count number of records of a particular type

  • Thread starter Thread starter phil.teale
  • Start date Start date
P

phil.teale

Hi There

Hopeing someone can help me.

I have a db containing a bunch of resumes that the user can search
through to find one that matches their criteria. When the resumes are
imported, they are prompted to select an employment category that those
resumes belong to. They can either select an existing category or
create a new one. This category is then written into a category table
and also into main the table along with a massive string that contains
the resume in text format.

Hope you are still with me!

I would like to the users to see how many resumes of each category
there are in the table. I could do this with DCount and use each
category as a criteria in the expression but the problem here is that I
will not know all the criteria beforehand.

So, I am wondering if anyone can help me extract each category from the
category table and read it into array so I can then pass each element
of the array to the Dcount function to get a result.
Any help/ideas would be much appreciated.

Cheers

Phil
 
No arrays or DLookups needed. You can do it much more efficiently in a
simple query ...

SELECT tblResume.Category, Count(tblResume.ResumeID) AS CountOfResumeID
FROM tblResume
GROUP BY tblResume.Category;

.... where 'tblResume' is the name of your resume table, 'ResumeID' is the
name of your primary key field, and 'Category' is the name of your category
field.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Thanks very much mate, I didn't realise that SQL had counting functions
in it, but when I think about it, it was thinking that what I was after
couldn't have been that rare, so maybe it makes sense after all (unlike
this rambling reply) I'll go now.
 
Back
Top