Solved

Report grouping

Posted on 2014-01-18
7
331 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
  • 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now