asp教程+access按年按月统计数据
/*
字段d_id(自动编号) d_je(货币型)d_sxrq(日期型)
表数据如下
d_id d_je d_sxrq
想按年按月来统计
如果选择年得到
月份
金额
如果选择年得到
月份
金额
*/
Select Year(D_SXRQ) As Y
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
Sum(IIF(Month(D_SXRQ) = D_JE )) As M
From D_FY
Group By Year(D_SXRQ);