Results 1 to 5 of 5
  1. #1
    okrobie is offline Novice
    Windows 7 Access 97
    Join Date
    Apr 2010
    Posts
    2

    How to group by month


    Hello, I have a date field in my database and I would like to group the dates by month in a query. Can someone help me do it?

  2. #2
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Build a calculated field in your query to display the month number like this:

    Code:
    RefMonth: Month([your date field])
    then group your query on RefMonth.

    Note ~ months in different years will group together with this. If this is a problem, then you'll need to do the same thing with YEAR()

    Cheers,

  3. #3
    okrobie is offline Novice
    Windows 7 Access 97
    Join Date
    Apr 2010
    Posts
    2
    Thank you ConneXionLost Mark me solved it works great. Regards

  4. #4
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Happy to help, but you'll need to mark it solved yourself. That must be done by the OP (Original Poster).

    Cheers,
    Last edited by ConneXionLost; 04-01-2010 at 10:51 PM. Reason: added URL

  5. #5
    l3111 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2011
    Location
    Manchester, UK
    Posts
    38
    Hi
    Can you help me develop this solution? I have a list of referrals, some on the same day, and i need to group them month and year. I have created a query which uses the formulas you have mentioned above (to show the month and the year) however, i have 19 entries, but only 15 are being counted.
    I then need to concatenate the month and year fields, and for this new field to be shown as March 2011, rather than the default 03-2011 that access insists upon.

    thennnnnn i would like to count this field to allow me to create a report that shows the following

    Month Referrals
    March 2011 5
    April 2011 3
    May 2011 6
    June 2011 5
    etc

    Can you help??

    l3111, Manchester, UK

Please reply to this thread with any new information or opinions.

Similar Threads

  1. month function..
    By thewabit in forum Programming
    Replies: 13
    Last Post: 04-19-2010, 10:01 PM
  2. by year by month
    By nkuebelbeck in forum Reports
    Replies: 21
    Last Post: 03-24-2010, 01:53 PM
  3. columns for group detail but not group header?
    By Coolpapabell in forum Reports
    Replies: 0
    Last Post: 08-21-2009, 08:53 AM
  4. Simple Report by Month
    By leejqs in forum Reports
    Replies: 3
    Last Post: 07-15-2009, 09:24 AM
  5. SQL Query by day to end of month
    By tcasey in forum Queries
    Replies: 0
    Last Post: 10-07-2008, 09:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums