473,382 Members | 1,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How do I force a MS Access crosstab to display a column or row title?

Hi All,

I'm using MS Access 2003 in a Windows XP environment.

I've created an aging report for my department that is based on what I call the "Main query" with an IIf statement that allows the user to define the dates into 30 day aging segments. Then I've created a crosstab query which counts the results.

How I'd like the report to appear is like this:

Expand|Select|Wrap|Line Numbers
  1. Entity_Type  | 1 to 30 days  |   31 to 60 days   |   Over 60 days
  2. OPFACT       |           0           |            0        |              0
  3. PARM        |           10           |           20       |              0
  4. WO             |           30          |           40    |                  0
  5. WR          |               20              |       30      |               0
The problem though is when I run the crosstab query, it will *not* output the "Over 60 day" column in the report because there are no values to count. Furthermore, the output is actually "Null" and not zero. That's another thing I'd like it to force (show a zero vs null). So my reports have outputted like this:

Expand|Select|Wrap|Line Numbers
  1. Entity_Type   |  1 to 30 days  |   31 to 60 days    
  2. PARM            |      10           |         20                   
  3. WO               |       30           |        40                    
  4. WR              |         20           |        30
Since OPFACT had no records to count, it does not show up on the report. Similarly, the Over 61 days does not show up either.




Here's my crosstab query:

Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Count(EP_Aging_Main_Query.STAT_DATE) AS CountOfSTAT_DATE
  2. SELECT EP_Aging_Main_Query.ENTITY_TYPE, Count(EP_Aging_Main_Query.STAT_DATE) AS [Total Of STAT_Date]
  3. FROM EP_Aging_Main_Query
  4. GROUP BY EP_Aging_Main_Query.ENTITY_TYPE
  5. PIVOT EP_Aging_Main_Query.[Date Interval];

And here is the query that it is based off of:

Expand|Select|Wrap|Line Numbers
  1. SELECT [01c_Report_Two_Six].CONCATENATED, [01c_Report_Two_Six].ENTITY_TYPE, [01c_Report_Two_Six].STAT_DATE, IIf([STAT_DATE]<#4/5/2007#,"Over 61 Days",IIf([STAT_DATE] Between #4/4/2007# And #4/8/2007#,"31 to 60 Days",IIf([STAT_DATE] Between #4/7/2007# And #4/14/2007#,"1 to 30 Days"))) AS [Date Interval]
  2. FROM 01c_Report_Two_Six
  3. GROUP BY [01c_Report_Two_Six].CONCATENATED, [01c_Report_Two_Six].ENTITY_TYPE, [01c_Report_Two_Six].STAT_DATE, IIf([STAT_DATE]<#4/5/2007#,"Over 61 Days",IIf([STAT_DATE] Between #4/4/2007# And #4/8/2007#,"31 to 60 Days",IIf([STAT_DATE] Between #4/7/2007# And #4/14/2007#,"1 to 30 Days")));

Any help would be greatly appreciated as I have two other reports that have this same issue.

Thanks!
Bob
Jun 10 '07 #1
1 4040
nico5038
3,080 Expert 2GB
I won't spoil the fun by posting the needed query, but the approach is "simple".
Just define an additional table with the four values needed and use an "OUTER JOIN" (LEFT or RIGHT) to connect this table with the field in your original query that should hold all column values.
Make this table "leading" by clicking on the JOIN-line in the graphical query editor and chosing option 2 (or 3) making this additional table "leading".
Now all values will appear :-)

Nic;o)
Jun 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
1
by: Richard Hollenbeck | last post by:
Hello Newsgroup. You have all been very helpful in the past and I thank you. I try to ask relevant questions so that they don't just benefit me, but also benefit the group. I'm currently...
1
by: Big Time | last post by:
I've got a crosstab query that counts the number of values in one of my tables. However, rather than giving me the number of instances of each record, what I would like is for each value to...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
1
by: Brad | last post by:
Thanks for taking the time to read my question. I have a table of data that has Date, Data and Category. I need to show, in a report, each Categories Data by Date. The Date has to be it's own...
2
by: Nenad Markovic | last post by:
Hi everybody, When executing a Crosstab Query I see only rows (defined in a row heading) that have values (defined in value field) in at least one column (defined as column headings). How can...
13
by: salad | last post by:
Operating in A97. I didn't receive much of a response conserning Pivot tables in Access. Pivot tables are nice, but a CrossTab will work for me too. Using a Pivot table, one is actually...
23
by: helm | last post by:
Folks, could anyone advise ... Is there a significant difference in crosstab capabilities in Access and Excel? Using Office XP 2002 ... to produce a crosstab report I developed it in Excel from...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.