Select B.Date
,sum(Recurring) as Recurring
From(Select A.Date
,(case when ServiceID = '0102592002' and Status like 'R%'
then COUNT(idTrueH) else 0 end) as Recurring
From(SELECT *
,dateadd(dd,6,TimeModify) as timeexprie
,DATEDIFF(dd,getdate(),dateadd(dd,6,TimeModify)) as difday
,CONVERT(varCHAR(10),TimeModify,110) as Date
FROM Tb_LogTrueH
WHERE
Status like 'R%' and convert(varchar(10),dateadd(dd,6,TimeModify),110) >= '12-16-2012'
and convert(varchar(10),TimeModify,110) <= '12-16-2012')A
Group by A.ServiceID,A.Status,a.idTrueH,A.Date)B
Group by B.Date
result
12-10-2012 >> 3
12-11-2012 >> 2
12-12-2012 >> 0
12-13-2012 >> 5
12-14-2012 >> 1
12-16-2012 >> 5
But I would result is
12-16-2012 >> 16
I would to Date and total
how would I do?
help me please?