Hi
I am trying to create a report and am looking to pull out some information from a table 'contact'. I am trying to pull out the 'advisor' relating to the contact and a count of contacts who have that advisor based on a set of criteria. This is fine and works, however, I want to pull out a third column which is also a 'Count' based on a different set of criteria. This is where I am having trouble.
Currently I have the below which states 'unable to parse query text':
SELECT advisoridName AS Advisor,
COUNT(*) WHERE (advisorid IS NOT NULL) AND (ContactType = 1) AND (StateCode = 0) AS 'Active Participants',
COUNT(*) WHERE (advisorid IS NOT NULL) AND (ContactType = 1) AS 'Total Participants'
FROM Contact
GROUP BY advisoridName, advisorid
ORDER BY PDA
It would be appreciated if you could steer me in the right direction.
Thanks in advance