Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting different items in one field in a table

Status
Not open for further replies.

ignacious

Technical User
Feb 11, 2004
11
US
I am trying to get a report, with a count, from a particular field in a table that has two possible entries.

FieldName
Item1
Item2

I would like to know how many of each item there is

Item1 = X
Item2 = X

Thank you
Ignacious
 
Ignacious,

Not sure if I understood your question but you may try these selects.

Count for Item1:

select count(FieldName)
from yourTable
where FieldName=Item1
group by FieldName

Count for Item2:

select count(FieldName)
from yourTable
where FieldName=Item2
group by FieldName

Hope this helps.

--mlz
 
I will try to be a little more specific. In the table I have

FieldName
Item1
Item2

I need to create a query or report to count how many of each item is listed in the FieldName. So then I would have a report that shows the quantity of each.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top