1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Group by month in Access Query

Discussion in 'Business Applications' started by dee5782, Apr 19, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. dee5782

    dee5782 Thread Starter

    Joined:
    Apr 19, 2007
    Messages:
    11
    See below the rough example of two columns of data pulled from a crosstab query which i am using. I'd like to group the dates by month for each number instead of having it list each day. Can i do this grouping in the query?

    Ex: What i've got now

    51351 12/1/2006
    51351 12/3/2006
    51351 1/4/2007
    51351 1/16/2007
    51333 12/1/2006
    51333 12/3/2006
    51333 12/4/2006
    51333 1/17/2007
    51333 1/18/2007


    What i would like to get:

    51351 12/2006
    51351 1/2007
    51333 12/2006
    51333 1/2007

    Thanks in advance for your help!
     
  2. Ziggy1

    Ziggy1

    Joined:
    Jun 17, 2002
    Messages:
    2,532
    Expr1: Format([YourDatefield],"m/yyyy")

    or

    Use the Month and YEAR functions

    Expr1:Month(yourDatefield)

    Expr2:YEAR(yourDatefield)
     
  3. dee5782

    dee5782 Thread Starter

    Joined:
    Apr 19, 2007
    Messages:
    11
    Great, thanks!
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/564098