换一个方式吧:
Select Month(ACDate) As ACDate,ACDTNo,Sum(ACAMT) As ACAMT
From acdtamt group by [month],ACDTNo Order by month(acdate)
Select Month(ACDate) As ACDate,ACDTNo,Sum(ACAMT) As ACAMT
From acdtamt group by [month],ACDTNo Order by month(acdate)
From acdtamt group by month(acdate) day(acdate),acdtno
order by month(acdate),day(acdate)没有年份的处理,如果数据有几年的数据的话,会把所有年的当月当天合并起来。