Group Dates in a query

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
 
V

Van T. Dinh

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")
 
J

Joan Wild

SELECT Format([DateField],"mmm-yy") AS MonthYr, Sum([Fee]) AS SumOfFee
FROM YourTable
GROUP BY Format([DateField],"mmm-yy");
 
S

sprinklingtarn

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 *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top