Solved

How format report from query results

Posted on 2014-01-16
3
405 Views
Last Modified: 2014-01-18
If you look at the sample screen shot I attached...

I am trying to figure out how to develop a report using the data.  But the report has to be formatted like:  (the field listing month = the name of the month)

                                                Jan     Feb     Mar     Apr      May     etc.-------

CountofCountOfID
SumOfListingPending
SumOfListingSold
etc. (These will be labels
on the report)

In other words, the months have to be displayed horizontally.  How can I do this?

--Steve
queryscreenshot.jpg
0
Comment
Question by:SteveL13
  • 2
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 39786318
You need a CrossTab report. Essentially you first create a Crosstab query, and then create a report based on that query.

See this MSFT article for more information: http://office.microsoft.com/en-us/access-help/create-a-crosstab-report-HP005187407.aspx

Be sure to make your query as complete as possible and be careful with column naming, since that can cause quite a bit of grief later on. See this MSFT blog posting for more info:

http://blogs.office.com/b/microsoft-access/archive/2012/05/23/using-crosstab-queries-in-reports.aspx
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39789696
Another workaround would be to simply insert the Crosstab query into a report as a sub report.

I am no expert on crosstab queries, but I am not sure getting multiple summaries on the bottom of he query/report will be easy.

Also note that your source data must be somehow filtered for a year, ...else each month will contain the data for all years (For example; the January column will contain data from 2012, 2013, 2014, ...etc)
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 250 total points
ID: 39789830
I am sorry, I did not realize that one of Scott's posts included a link for inserting the crosstab query as a report...
:-(

But here is one more if you are feeling bold...

You could also build a report and include aggregate functions
It may look tedious, but once you get the first month done, all you need to do is copy all the summary textboxes for that month and increment the month value in the formula by 1
This may be an option if you want more control over how you format the report...
(I did this for a co-worker because they wanted to do things like conditional formatting ...etc, with the output (They also wanted sums of the summaries, so it really got complex...

The bottom line is that since a crosstab query "dynamically" creates the columns each time it is run, (based on the current data), you cannot "easily" create a Crosstab Report.
In a report, the columns are hardcoded.

What Scott posted are the standard ways to create true "crosstab" Reports
My suggestion here is another to get the same output, with a "simulated" crosstab. (it may run a bit slower than Scott's suggestions

..take from his what you like...
...and enjoy the weekend

JeffCoachman

Sample attached
Access-EEQ-28340433-Aggregate-Si.mdb
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ms access 2010 vba, copy table from db1 to db2 from db3 27 46
Access datasheet - showing a number in scientific notation 4 23
backup programme - VBA 3 24
Help with DoEvents 8 28
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

823 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