I need to write a select that counts fields for multiple conditions. I tried putting my conditions in the count function like this:
But I kept getting the same results for each column (even though I know they don't match). Is there some way to do this in one query or do I have to combine a bunch of selects together? I am using VFP 8 (and 9 beta) by the way.
Sebastian
Code:
SELECT County, State, COUNT(!RSPFlag AND MailFlag) as AddrCount, COUNT(RSPFlag AND MailFlag) as AddrResp FROM csrProspects GROUP BY County, State ORDER BY State, County
But I kept getting the same results for each column (even though I know they don't match). Is there some way to do this in one query or do I have to combine a bunch of selects together? I am using VFP 8 (and 9 beta) by the way.
Sebastian