Results 1 to 4 of 4
  1. #1
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70

    group record by months

    Hi everyone

    i would like to know if it possible to group months, here is what i have so far :
    Code:
    SELECT Source.ID, Clusters.Cluster_Desc, Department.Dept_Desc, DatePart('m',Source.Day_Month_Year) AS [Month], Source.Original_Source, Source.Headline, Source.Issue, Source.Analysis, Source.Action
    FROM Source INNER JOIN (Department INNER JOIN (Clusters INNER JOIN Cluster_Dept ON Clusters.Cluster_ID = Cluster_Dept.Cluster_ID) ON Department.Dept_ID = Cluster_Dept.Dept_ID) ON Source.ID = Cluster_Dept.ID
    GROUP BY Source.ID, Clusters.Cluster_Desc, Department.Dept_Desc, Source.Original_Source, Source.Headline, Source.Issue, Source.Analysis, Source.Action, Source.Day_Month_Year;
    basically what i want is for all relevant articles for that particular month to show within that month

    thanks in advance

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Have you tried instead of

    Group By
    .....
    .....
    Source.Day_Month_Year

    in your query as

    Group By
    .....
    .....
    DatePart('m',Source.Day_Month_Year)

    or [Month]

    Also, perhaps in a report, you should be able to group by [Month](Would suggest different Name such as TheMonth,etc) the results of the query.

    Thanks

  3. #3
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70
    the results will be displayed in a graph , and based on a start date and end date and a combo box selection. the changes that you told me about now i had just did before your reply. now what i am trying to do is group the I.D as i am noticing that there can 7 articles for a particular department but on different days but within that particular Month. any ideas?

  4. #4
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Not in to reports, graphs. Just hold on till some one comes along.
    Meanwhile, would suggest posting a few dummy data along with the results you want out of it.
    Should make it easier for some one to help the first time round.

    Thanks

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

Similar Threads

  1. Sum only first record of group
    By RogerC in forum Access
    Replies: 3
    Last Post: 07-18-2012, 10:19 PM
  2. Replies: 2
    Last Post: 06-21-2012, 07:40 PM
  3. Replies: 5
    Last Post: 09-22-2011, 02:10 PM
  4. Percent Change between months by group
    By P5C768 in forum Queries
    Replies: 3
    Last Post: 09-15-2010, 06:59 PM
  5. GROUP numerous lines to one record
    By tweetyksc in forum Queries
    Replies: 3
    Last Post: 07-21-2010, 01:14 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