NEED EXPRESSION FOR COUNTING QUERY

  • Thread starter Thread starter William
  • Start date Start date
W

William

Access 2003/xp

I have a column in which each cell has one of five two-letter entries (ET,
EL, IT, IL, LP). I need to create an expression that can will count just one
of entries (e.g., ET).

Can someone help with this expression?

Thanks,
 
SELECT [TableName].[FieldName], Count([TableName].[FieldName]) AS
[CountOfFieldName] FROM [TableName] GROUP BY [TableName].[FieldName]
HAVING ((([TableName].[FieldName])="ET"));
 
Perhaps one of the following expressions will work for you

Count(IIF(FieldName="ET",1,Null))

Abs(Sum(FieldName="ET"))

DCount("*","YourTable","FieldName='ET'")

OR you could use a subquery.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top