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

x
?
Solved

How format report from query results

Posted on 2014-01-16
3
Medium Priority
?
411 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
[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
3 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1000 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 1000 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

722 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