473,394 Members | 1,746 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,394 software developers and data experts.

Crosstab query, make every category show

TheSmileyCoder
2,322 Expert Mod 2GB
I have a crosstab query where I have Main item as the rows, and Category as the columns, and count(Category) as the value.

Basicly im counting how many observations of each category that is for each Main Item. My problem is that there is no Category A observations, my crosstab will not show that column.

How can I make the each of the category's show up, even if the count is 0?

Thank you
Apr 23 '10 #1

✓ answered by MikeTheBike

@TheSmileyOne
Hi

If the 'catergoies' filed has a fixed number of categories (and names), then you can specify what columns are included in the cross tab by entering then in the query's 'column heading' of its property dialogue (this will also specify the order of the columns). These columns will be included even when no data is returned.

The line below is an example of the same thing in SQL view (this order the months in the correct order as sorting the list will not!).

Expand|Select|Wrap|Line Numbers
  1. PIVOT Format([absdate],"mmm") In ("Nov","Dec","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct");
Note; Our finacial year is from November to October.

I believe there in som info in access help on this topic, if you know where to look(press F1 with the Column Headings field of the query property dialogue selected).

HTH


MTB

1 1342
MikeTheBike
639 Expert 512MB
@TheSmileyOne
Hi

If the 'catergoies' filed has a fixed number of categories (and names), then you can specify what columns are included in the cross tab by entering then in the query's 'column heading' of its property dialogue (this will also specify the order of the columns). These columns will be included even when no data is returned.

The line below is an example of the same thing in SQL view (this order the months in the correct order as sorting the list will not!).

Expand|Select|Wrap|Line Numbers
  1. PIVOT Format([absdate],"mmm") In ("Nov","Dec","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct");
Note; Our finacial year is from November to October.

I believe there in som info in access help on this topic, if you know where to look(press F1 with the Column Headings field of the query property dialogue selected).

HTH


MTB
Apr 23 '10 #2

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

Similar topics

3
by: Randy Harris | last post by:
I've been trying to construct a Crosstab query (mess pasted below) that would output all rows, even if the Value (a count) is 0. No matter what I do, it only returns rows that have matching...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
15
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows...
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...
2
by: Mike | last post by:
Hi everyone, I found the Access reports too limited to do what i wanted so i created a module to export a crosstab query to an excel file, and then i modify it as i want. My problem is that i...
4
by: m.wanstall | last post by:
I have a crosstab query that compiles data for Months of the year. I have a stacked select query on top of that crosstab query that uses the latest 2 months data and exports it to a fixed length...
2
by: Ecohouse | last post by:
I'm using Access 2002. I'm creating a report dynamically using a crosstab query. I found the code for this on the Microsoft site. I noticed that the report doesn't go past six pages. How can I...
4
by: mattlightbourn | last post by:
Hi all, I have a problem which has been driving me nuts. Crosstab queries! I have a database witch a few different tables to do with garment manufacturing. I have a table for a client...
3
by: Hansen | last post by:
Hi I have one table with the following design: Fieldname Datatype Region Text Supply Number Sales Number Revision Number...
8
by: Paul H | last post by:
I want to base a form on a crosstab query. The query shows statistics for a user defined period. The column headings will look something like this: ClientID Month01 Month02 Month03 etc.. ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.