Help Calculating YTD

cms2012

Registered User.
Local time
Today, 01:10
Joined
May 18, 2012
Messages
52
Hey everybody,

I am trying to calculate YTD sales and I was wondering if anybody has any ideas on how to do this. Here is the SQL for the query that I have right now:

SELECT [TOTAL SALES].EMPL_LAST_NAME, [TOTAL SALES].metMonth, [TOTAL SALES].metYear, Sum([TOTAL SALES].TOTAL_SALES) AS YTDSALES
FROM [TOTAL SALES]
GROUP BY [TOTAL SALES].EMPL_LAST_NAME, [TOTAL SALES].metMonth, [TOTAL SALES].metYear;

If anyone could help I would be greatly appreciative!

Thanks
 
Apply criteria to the field that indicates the date so that you only include those records that fall within the correct time frame.
 
Would that work even if I had 4 years worth of data?
 
You could have an infinity amount of data and if you wanted just the 5 months worth that occured in this year it would work.
 

Users who are viewing this thread

Back
Top Bottom