Count of times "A" appears in query

Elmobram22

Registered User.
Local time
Today, 06:12
Joined
Jul 12, 2013
Messages
165
Hi,

I have a query that gives a value in a column either "A","V","L","H","P","S" or blank.

I want to be able to count the amount of occurunces of each letter and hold that number in a column. Is it easy to do?

Cheers,

Paul
 
You mean a GROUP BY Query?
Code:
SELECT theColumnName, Count(thecolumnName) As NoOfOcc
FROM theQuery
GROUP BY theColumnName;
 
I kinda want a query like this...

Id Name A V L H P S
---------------------------------------------------------------------------------------------------------
01 PAUL 2 0 0 1 0 1
02 JOHN 3 1 1 0 0 0

The ID would be from TblStaff and the occurances are from a query QryDeductionsandSleep Ins
 
Yes crosstab, except in this case that wouldnt show P

perhaps....
Code:
Select ID, sum(IIF(Column= "A",1,0)) as A
, sum(IIF(Column= "B",1,0)) as B
,...
group by ID
 

Users who are viewing this thread

Back
Top Bottom