Hello,
I have a query that looks like this:
select convert(varchar(12),querydatetime,101) as date,
count(uniquefieldId)
from CMquery
where datepart(month,querydatetime)=datepart(month,getdate())-1
and (majorTrigger=45 or thisfield='aaaa')
group by convert(varchar(12),querydatetime,101)...