Report grouping

Posted on 2014-01-18
Last Modified: 2014-01-19
I want to make a report from a query. The query has a date column with dates throughout the year.

My end result is I want three grouping of the report 1 Group for the current Day. The second group for the current week and the third group for the current year.

Can I do these groupings from the report or the query? Do I need to write seperate queries for each grouing and then join them in one big group?
Question by:cansevin
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39791184
do the grouping in the report.

Author Comment

ID: 39791185
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39791192
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

LVL 48

Expert Comment

by:Dale Fye
ID: 39791223
You could also create a computed colum in the query, something like:

RptGrp: iif([DateColumn] = Date(), 1, IIF(Week([DateColumn]) = Week(Date()), 2, 3))

If you dates outside of the current year, you would need to either filter those out of the report, or modify to include another IIf( ) statement.

The problem is, that today falls into all three of those group definitions, but a specific record could only fall into one of those categories, so todays record could not show up in the Today, Week, and Year groupings.
LVL 74

Accepted Solution

Jeffrey Coachman earned 500 total points
ID: 39791329

If having the overlapping dates in the report is a hard requirement, you can create a separate query for each date range.  (...adding in a "DateSpec" column for each query: CurrentDay, CurrentWeek, CurrentYear)

Then UNION all three queries into one query.

Then create a Report from the Union query, grouping on the DateSpec Field.

See the attached sample

LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39791347
cansevin, follow up...

Typically, in situations like this (overlapping data), a separate report for each Date grouping is used.
You can run all of them all in a batch operation so that they all print out at the same time.

...Because if you keep them all in one report, ...ultimately you will be asked..."Can you just give me a report with the current week?"


Author Closing Comment

ID: 39792205
Thanks! This will lead me in the right direction.

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question