Count of query records

  • Thread starter Thread starter Dsperry101 via AccessMonster.com
  • Start date Start date
D

Dsperry101 via AccessMonster.com

Hello all ,

I have a query that is selecting records from a table that match a string
input
buy the user in the Query By Example screen. I have under the criteria field
the
line - Like "*" & [Input string to find in log entries] & "*" . I want to
also put the number of
records that matched the string in the query but I can not include the count
(*) in the Query
By Example screen.
I could do two separate queries but I don't want to input the string
twice.


Thanks

Dan S
 
Hello all ,

I have a query that is selecting records from a table that match a string
input
buy the user in the Query By Example screen. I have under the criteria field
the
line - Like "*" & [Input string to find in log entries] & "*" . I want to
also put the number of
records that matched the string in the query but I can not include the count
(*) in the Query
By Example screen.
I could do two separate queries but I don't want to input the string
twice.

Thanks

Dan S

Does this help?

SELECT tblBasicData.FieldName, Count(tblBasicData.FieldName) AS
CountOfFieldName
FROM tblBasicData
GROUP BY tblBasicData.FieldName
HAVING (((tblBasicData.FieldName) Like "*" & [What] & "*"));
 
fredg,

When I put that line in the SQL view of the Query by example it gives me
a column
CountOfFieldName with a 1 in each line selected by the query to indicat the
count
of that entry ?
I want a count of entries selected by the query which you can get with
count(*) in the
Field line of Query By Example screen but I can't combine that and the query
to get the
fields and list of hits


DanS said:
Hello all ,
[quoted text clipped - 13 lines]

Does this help?

SELECT tblBasicData.FieldName, Count(tblBasicData.FieldName) AS
CountOfFieldName
FROM tblBasicData
GROUP BY tblBasicData.FieldName
HAVING (((tblBasicData.FieldName) Like "*" & [What] & "*"));
 

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