Group Dates in a query

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi All,

How do I group dates in a query?
What I have is date values in a table stored in dd/mm/yy format in my query
I would like to group all dates by month.
So for instance
Date Fee
1/1/03 10
3/1/03 20
2/2/03 50
etc

would give

Date Fee
Jan-03 30
Feb-03 50
etc

I'm using access 2000

TIA
Mark
 
Try:

SELECT Format(T.DateField, "mmm-yy") As MonthYear,
Sum(T.Fee) As SumOfFee
FROM YourTable As T
GROUP BY Format(T.DateField, "mmm-yy")
 
SELECT Format([DateField],"mmm-yy") AS MonthYr, Sum([Fee]) AS SumOfFee
FROM YourTable
GROUP BY Format([DateField],"mmm-yy");
 
Mark said:
*Hi All,

How do I group dates in a query?
What I have is date values in a table stored in dd/mm/yy format in my
query
I would like to group all dates by month.
So for instance
Date Fee
1/1/03 10
3/1/03 20
2/2/03 50
etc

would give

Date Fee
Jan-03 30
Feb-03 50
etc

I'm using access 2000

TIA
Mark *
 
Back
Top