Just curious:
SELECT date, type, COUNT(count) FROM countit GROUP BY date
SELECT date, type, COUNT(count) FROM countit WHERE type='user' Group by type
Why isn't the dbms complaining that you've got nonaggregated fields that aren't grouped ('type' in the first one, and 'date' in the second)?
The only way I can see negative numbers getting into your results is if $datetotal < $usertotal - that being the only subtraction going on. Since a priori I don't see any reason why the first query won't return multiple rows (once for each date), and the only reason why the second will only return one row is because the field in the group by clause is being used in the where clause (making the group by irrelevant, incidentally) ... I don't see anything to specify which date you're trying to get a count of, and if the query does return multiple rows, you only look at the first - without apparently caring what date it is for.