Hello experts,
Im trying to count the all the values that are either 'DNA', 'CANX', Closed Open from a query. I want to count each value as display them as seperate colunms in the results.
this is the query that i use to retireve just one colunm
SELECT distinct tblClients.strClientName, tblWorkTypes.strName,
tblStates4Work.strDesc AS strDesc, COUNT(dbo.tblStates4Work.s
trDesc) as totalClosed
FROM tblClients INNER JOIN
tblCases ON tblClients.uidClient = tblCases.fkCompany INNER JOIN
tblCaseTypes ON tblCases.fkCaseType = tblCaseTypes.uidCaseType INNER JOIN
tblFME ON tblCases.uidCase = tblFME.fkCase INNER JOIN
tblStates4Work ON tblFME.fkState4Work = tblStates4Work.uidStates4W
ork INNER JOIN
tblWorkTypes ON tblFME.fkWorkType = tblWorkTypes.uidWorkType
WHERE (tblFME.ccyFee = 0) and tblStates4Work.strDesc = 'Closed' and (tblWorkTypes.strName = 'IMA')
GROUP BY tblClients.strClientName, tblWorkTypes.strName, tblStates4Work.strDesc
This retrieves data like this the last colunm is the data i really need
AA1 TPS IMA Closed 4
Air Products IMA Closed 2
Allianz IMA Closed 1
Ascent IMA Closed 3
Aspen Re IMA Closed 1
Atkins Ltd IMA Closed 5
but what i wan is a single query that retrives all values types.
Does anyone know how to do this?
Start Free Trial