A Simple Query Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to setup a query that returns the number of occurences in a field
based off the total count of records. For instance if i have 60 records and
out of those 60, 2 were completed by user A, my query result would return the
number 2. Any help is appreciated...

Thanks!
 
select User, count(*) from YourTable group by [YourTable].[User];

This SQL would return a count for each user entered. In Query Builder grid,
you'll have:
Field: Expr1: Count(*) User
Table: YourTable
Total: Expression Group By
 
Thanks Chris and Chaim... I entered the statement and now for the 60 records
the query is returning one record that shows 58 and another that shows the 2
i am trying to get. Is there anyway to get rid of the 58 and just show 2?

Thanks again...

Chaim said:
select User, count(*) from YourTable group by [YourTable].[User];

This SQL would return a count for each user entered. In Query Builder grid,
you'll have:
Field: Expr1: Count(*) User
Table: YourTable
Total: Expression Group By

--
Chaim


Ray said:
I am trying to setup a query that returns the number of occurences in a field
based off the total count of records. For instance if i have 60 records and
out of those 60, 2 were completed by user A, my query result would return the
number 2. Any help is appreciated...

Thanks!
 
Nevermind i figured it out.. thanks again you two!

Ray said:
Thanks Chris and Chaim... I entered the statement and now for the 60 records
the query is returning one record that shows 58 and another that shows the 2
i am trying to get. Is there anyway to get rid of the 58 and just show 2?

Thanks again...

Chaim said:
select User, count(*) from YourTable group by [YourTable].[User];

This SQL would return a count for each user entered. In Query Builder grid,
you'll have:
Field: Expr1: Count(*) User
Table: YourTable
Total: Expression Group By

--
Chaim


Ray said:
I am trying to setup a query that returns the number of occurences in a field
based off the total count of records. For instance if i have 60 records and
out of those 60, 2 were completed by user A, my query result would return the
number 2. Any help is appreciated...

Thanks!
 
Back
Top