I need obtain a few field counts but based on different criteria.  The
following almost works but I need something like this:

(COUNT(cn) ='21') AS C21_COUNT AND
(COUNT(cn) ='20') AS C20_COUNT

I tried doing this in a UNION but could not get it working.  Can COUNT be
used on a varchar field...?  I also need the totals not based on the
grouping, I can do this with a separate query no problem, but it seems like
I should be able to get it our of a single query...



SELECT

source,
COUNT(*) AS source_count,
COUNT(match) AS match_fld61,
COUNT(cn) AS C21_COUNT,
COUNT(cn) AS C20_COUNT

FROM mytable

WHERE ship_date BETWEEN #form.datefrom# AND #form.dateto#

GROUP BY source

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to