Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Report grouping

Posted on 2014-01-18
7
Medium Priority
?
336 Views
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?
0
Comment
Question by:cansevin
[X]
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
7 Comments
 
LVL 120

Expert Comment

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

Author Comment

by:cansevin
ID: 39791185
How?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39791192
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 2000 total points
ID: 39791329
cansevin,

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
;-)

JeffCoachman
Access-EEQ28342215-Report-Curren.mdb
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39791347
cansevin,

...to 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?"
;-)

JeffCoachman
0
 

Author Closing Comment

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

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

715 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