Counting Occurances

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

I've got a query that works about 95% of the way I
want/need it to. I'm hoping that someone can help me get
it completed.

Here is what I'm working with. I have field in a table
that contains a query string (that I parsed from a URL).
Within this field there can be one or more occurances of
a 'search type' (i.e. TI, AU, A0, YR, and so on). I've
used the syntax, listed below:

Author: Sum(IIf([SearchQuery] Like "*A0*",1,0))

Here is a sample of the field being reviewed:

Query=((A0+Drummond)+AND+(A0+Fanklin))

The problem is that when a line contains more than one
occurance, it is not getting counted. In short, access
assumes the IIF criteria is met on the first 'hit' and
moves on.

My question is what would be a better way to accomplish
getting a count of all the items. I've tried using the
count function but that has resulted in getting a total
count of the number of records (not what I'm looking for).

Thank you for any/all help.
 

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

Back
Top