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
Solved

How format report from query results

Posted on 2014-01-16
3
406 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

790 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