Sort date field by year (not day)

L

Laury

I have a query where I group by a name, then trans date, then type (with a
count on type). Currently, it is giving me a count of type by name and day.
Ex.
Group 1 - 1/1/08 - Type A - 34
Group 1 - 1/2/08 - Type A - 34
I would like to get count of type by name and year.
Ex.
Group 1 - 2008 - Type A - 1650

I do not know how to do sql stuff, so I'm hoping for a simple something that
I can type in the criteria box. If not, please be detailed on how to do what
I need to do. Thank you for any help!
 
L

Laury

Thank you SO much! That worked perfectly.

RonaldoOneNil said:
Simply change the date field in your query to Year([Datefield])

Laury said:
I have a query where I group by a name, then trans date, then type (with a
count on type). Currently, it is giving me a count of type by name and day.
Ex.
Group 1 - 1/1/08 - Type A - 34
Group 1 - 1/2/08 - Type A - 34
I would like to get count of type by name and year.
Ex.
Group 1 - 2008 - Type A - 1650

I do not know how to do sql stuff, so I'm hoping for a simple something that
I can type in the criteria box. If not, please be detailed on how to do what
I need to do. Thank you for any help!
 
G

ghetto_banjo

In your query, instead of grouping on the date, group on:

Year([TransDate])

Type that in the Field box, not the criteria.



The Year function returns just the date.
 

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