Hi Steven.
You can use something like this -
SELECT (YEAR(ddate) * 100 + MONTH(ddate)) as nmonth, ccode, COUNT(ccode) AS cnt ;
FROM test ;
GROUP BY nmonth, ccode
HTH
Dan
>I have a table with a date field and a code field. The code field can be a 1 or a 2. I want to see how many 1's there are per each month of the date field and do the same for the 2's. Can this be done with one SQL statement?