group on year

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In design view in an access query:
I have a date field. I want to group the returns based on based on the year.
Can I do this is the total row?
 
SELECT Year([Date Field]) as TheYear,
Sum([Field1]) AS SumField1,
Sum([Field2]) AS SumField2
FROM YourTable
GROUP BY Year([Date Field])
ORDER BY Year([Date Field]) ;

Or in the query design view, surround the date field with:
Year([TheDateField])

Make sure that you go up to View and select Totals. Group By should be under
the date field.
 
Let's talk design view:
Where in design view (with the total view) am I putting
Year([TheDateField])



Jerry Whittle said:
SELECT Year([Date Field]) as TheYear,
Sum([Field1]) AS SumField1,
Sum([Field2]) AS SumField2
FROM YourTable
GROUP BY Year([Date Field])
ORDER BY Year([Date Field]) ;

Or in the query design view, surround the date field with:
Year([TheDateField])

Make sure that you go up to View and select Totals. Group By should be under
the date field.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


sierralightfoot said:
In design view in an access query:
I have a date field. I want to group the returns based on based on the year.
Can I do this is the total row?
 
Let's talk design view:
Where in design view (with the total view) am I putting
Year([TheDateField])

In a vacant Field cell in the top row of the query grid.

John W. Vinson [MVP]
 

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

Back
Top