Solved

Report grouping

Posted on 2014-01-18
7
326 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 119

Expert Comment

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

Author Comment

by:cansevin
ID: 39791185
How?
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 39791192
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 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