SELECT distinct(b.fieldname),CONVERT(varchar,SUM(a.fieldname),1) as total
from tablename a, tablename b
where a.fieldname=b.fieldname
group by b.tablename
select FieldName,count(FieldName)as alias from tablename
where fielddate>= DATEADD(month, DATEDIFF(month, 0, getdate()) - 1, 0)
AND dt < DATEADD(month, DATEDIFF(month, 0, getdate()), 0)
group by FieldName
HAVING COUNT(FieldName) >= 1
ORDER BY FieldName ASC
END