Question : Month Totals

I am trying to create a query to giving running totals for the last 14 months. In the where clause, I am using DatePart('m',Date())-1, or -2, or -3..... It works fine until I transition a year. ANd of course each month will change where the transition takes place. What is the best way to handle this?

Answer : Month Totals

Try with this.

/gustav
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
SELECT 
  Sales_Details.Name, 
  Sum(Sales_Details.Amount) AS SumOfAmount, 
  DateDiff("m",Date(),[D_Date]) AS Month2
FROM 
  Sales_Details
GROUP BY 
  Sales_Details.Name, 
  DateDiff("m",Date(),[D_Date])
HAVING
  DateDiff("m",Date(),[D_Date]) Between -1 And -14;
Random Solutions  
 
programming4us programming4us