SELECT DATEPART(Month, [Transaction].Time) As Month,
DATEPART(DAY, [Transaction].Time) AS Day,
COUNT(*) AS TotalTran ,
SUM([Transaction].Total) AS Total
FROM Register
INNER JOIN Batch ON Register.ID = Batch.RegisterID
INNER JOIN [Transaction] ON Batch.BatchNumber = [Transaction].BatchNumber
WHERE [Transaction].Time BETWEEN '08/01/2005' AND '12/31/2009'
GROUP BY DATEPART(Month, [Transaction].Time),
DATEPART(DAY, [Transaction].Time)
|