我需要运行一个报告,指出特定创意每月的记录数。对于每个月我的查询不止一次显示该月。难道是我做错了什么:我的脚本:我的SqlCode中的逻辑错误
Select DATEPART(mm,DatePrinted),COUNT(ReceiptNo)As CardPrinted
from mytble where ReceiptNo like'990%'
Group by DatePrinted
posits receipt:800,75。
上午预计类似:
月TOTALCOUNT
二月TOTALCOUNT等
您怎么弄? – Ashalynd
您想将2012年1月和2013年1月分组在一起或分开吗? –