+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Forum Contributor
    Join Date
    03-18-2009
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2003
    Posts
    104

    Group by query question

    How would I group by month if I have a set of dates in the individual fields? Essentially I have data that I want to group by month in the "dates" column and then perform sum of expenses in the "expenses" column. I know it's a very simple question.
    Last edited by eonizuka; 12-17-2009 at 08:22 PM.

  2. #2
    Forum Moderator ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2003 & 2010
    Posts
    1,797

    Re: Group by query question

    Hi eonizuka,

    Group By this as a Calculated Field in the query:

    Code:
    SumMonth: Year([Dates]) & " " & MonthName(Month([Dates]))
    you may also want to use this to give it a chronological sort:

    Code:
    SumMonthSort: Year([Dates]) & " " & Month([Dates])
    you won't need to display the sort.

    Cheers,
    Docendo discimus.

    Please consider:
    • Thanking those who helped you. Click the reputation icon in the contributor's post and add Reputation.
    • Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Contributor
    Join Date
    03-18-2009
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2003
    Posts
    104

    Re: Group by query question

    Quote Originally Posted by ConneXionLost View Post
    Hi eonizuka,

    Group By this as a Calculated Field in the query:

    Code:
    SumMonth: Year([Dates]) & " " & MonthName(Month([Dates]))
    you may also want to use this to give it a chronological sort:

    Code:
    SumMonthSort: Year([Dates]) & " " & Month([Dates])
    you won't need to display the sort.

    Cheers,
    Hi ConnexionLost,

    Thank you for your help with this. In which row of the query should the expression "Year([Dates]) & " " & MonthName(Month([Dates]))" be input? Is it in the criteria row? I have a bunch of dates in a field named "contractdate". Yes, I'm very much an Access beginner, thanks for your patience.

  4. #4
    Forum Moderator ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2003 & 2010
    Posts
    1,797

    Re: Group by query question

    Hi eonizuka,

    Happy to help.

    Put the SumMonth in as a new/empty column in the Field row. Use it in place of your "contractdate" with the "Group By" in the Totals row.

    Code:
    SumMonth: Year([contractdate]) & " " & MonthName(Month([contractdate]))
    Cheers,
    Docendo discimus.

    Please consider:
    • Thanking those who helped you. Click the reputation icon in the contributor's post and add Reputation.
    • Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  5. #5
    Forum Contributor
    Join Date
    03-18-2009
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2003
    Posts
    104

    Re: Group by query question

    Excellent. Thank you very much for your help.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0