Group month and year

  • Thread starter Thread starter EveNg
  • Start date Start date
E

EveNg

Guest
my date field is in mm/dd/yyyy format. The dates are varies. I need to group the same month within the same year from the above format, not the days.

reason: to shows the total numbers of customers paying on the same month and year from the different dates.

Any idea how and where should i work on this? Pls help/ any other suggestions will be appreciated!!
 
if i understand you well!


SELECT DISTINCTROW Format$([My_TBL].[My_date], 'mmmm yyyy') AS [date By Month], Sum([My_TBL].[money]) AS [total numbers of customers paying]
FROM My_TBL
GROUP BY Year([My_TBL].[My_date])*12 + DatePart('m',[My_TBL].[My_date]) -1, Format$([My_TBL].[My_date], 'mmmm yyyy');


i hope that i help you.
 

Users who are viewing this thread

Back
Top Bottom