473,698 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help needed for crosstab query

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 records. Is it possible to do
this? I have a report based on the query that needs to show all of the
products and activities, even if the EventID is 0.

I'm grateful for any suggestions.
TRANSFORM Count(TrainingC enterSummary_qr y.EventID) AS CountOfEventID
SELECT TrainingCenterS ummary_qry.Prod uctName,
TrainingCenterS ummary_qry.Acti vity, TrainingCenterS ummary_qry.Cour seNumber,
Count(TrainingC enterSummary_qr y.EventID) AS [Total Of EventID]
FROM TrainingCenterS ummary_qry
GROUP BY TrainingCenterS ummary_qry.Prod uctName,
TrainingCenterS ummary_qry.Acti vity, TrainingCenterS ummary_qry.Cour seNumber
PIVOT TrainingCenterS ummary_qry.Clas sroomCity;
Nov 12 '05 #1
3 3025
"Chuck Grimsby" <c.*******@worl dnet.att.net.in valid> wrote in message
news:9c******** *************** *********@4ax.c om...


Does the TrainingCenterS ummary_qry show all the events?
Yes, all of the events appear in that query. What I need, is to have the
report include all possible row and column combinations, whether there is a
corresponding event or not. I've tried joining the table to itself and
every other combination I can think of, but can't get the crosstab to
include the rows that don't have matching records.
If not, you need to fix that, not the crosstab.

On Sat, 22 Nov 2003 09:34:18 GMT, "Randy Harris" <ra***@SpamFree .com>
wrote:
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 Ido, it only returns rows that have matching records. Is it possible to dothis? I have a report based on the query that needs to show all of the
products and activities, even if the EventID is 0.
I'm grateful for any suggestions.

TRANSFORM Count(TrainingC enterSummary_qr y.EventID) AS CountOfEventID
SELECT TrainingCenterS ummary_qry.Prod uctName,
TrainingCenter Summary_qry.Act ivity, TrainingCenterS ummary_qry.Cour seNumber,Count(Training CenterSummary_q ry.EventID) AS [Total Of EventID]
FROM TrainingCenterS ummary_qry
GROUP BY TrainingCenterS ummary_qry.Prod uctName,
TrainingCenter Summary_qry.Act ivity, TrainingCenterS ummary_qry.Cour seNumberPIVOT TrainingCenterS ummary_qry.Clas sroomCity;

--
Party On Dudes!

Nov 12 '05 #2
Anyone know if there is a way to "trick" the crosstab into outputting all of
the rows, even if the count is 0?

"Randy Harris" <ra***@SpamFree .com> wrote in message
news:u4******** **************@ newssvr28.news. prodigy.com...
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 records. Is it possible to do
this? I have a report based on the query that needs to show all of the
products and activities, even if the EventID is 0.

I'm grateful for any suggestions.
TRANSFORM Count(TrainingC enterSummary_qr y.EventID) AS CountOfEventID
SELECT TrainingCenterS ummary_qry.Prod uctName,
TrainingCenterS ummary_qry.Acti vity, TrainingCenterS ummary_qry.Cour seNumber, Count(TrainingC enterSummary_qr y.EventID) AS [Total Of EventID]
FROM TrainingCenterS ummary_qry
GROUP BY TrainingCenterS ummary_qry.Prod uctName,
TrainingCenterS ummary_qry.Acti vity, TrainingCenterS ummary_qry.Cour seNumber
PIVOT TrainingCenterS ummary_qry.Clas sroomCity;

Nov 12 '05 #3
DFS
"Randy Harris" <ra***@SpamFree .com> wrote in message
news:U0******** **************@ newssvr28.news. prodigy.com...
Anyone know if there is a way to "trick" the crosstab into outputting all of the rows, even if the count is 0?

Yes, there is a way.

Change the last line of the Crosstab (the PIVOT line) so it's like this:

PIVOT TableName.Field Name in ('Field1','Fiel d2','Field3','F ield4',...)



"Randy Harris" <ra***@SpamFree .com> wrote in message
news:u4******** **************@ newssvr28.news. prodigy.com...
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 records. Is it possible to do this? I have a report based on the query that needs to show all of the
products and activities, even if the EventID is 0.

I'm grateful for any suggestions.
TRANSFORM Count(TrainingC enterSummary_qr y.EventID) AS CountOfEventID
SELECT TrainingCenterS ummary_qry.Prod uctName,
TrainingCenterS ummary_qry.Acti vity,

TrainingCenterS ummary_qry.Cour seNumber,
Count(TrainingC enterSummary_qr y.EventID) AS [Total Of EventID]
FROM TrainingCenterS ummary_qry
GROUP BY TrainingCenterS ummary_qry.Prod uctName,
TrainingCenterS ummary_qry.Acti vity, TrainingCenterS ummary_qry.Cour seNumber PIVOT TrainingCenterS ummary_qry.Clas sroomCity;


Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
17664
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 Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
15
4397
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 of students and columns of activities and the data are the students' scores in each activity. No problem, almost. The problem is that there are five classes at the moment and will be more classes (or courses) in future semesters. I don't want...
6
2912
by: Gary | last post by:
I have an example table with fields and records as shown below: RECORD_ID DATE PRODUCT QUANTITY 1 4/1/05 widget1 50 2 4/2/05 widget1 48 3 4/3/05 widget1 42 4 4/4/05 widget1 28 5 4/5/05 widget1 13 6 4/6/05 widget1 5 .. . . .
4
8124
by: Judy | last post by:
I'm using Access 2003 and was wondering if it is possible to have a paramater selection within a crosstab query so that I wouldn't need to build a new table. I have a select query that I'm using to build the crosstab query from. In the select query I'm prompting for a specific quarter but when I go to run the crosstab it doesn't seem to like the parameter that has been put on the select query and returns a message of "The Microsoft Jet...
7
1902
by: newguy | last post by:
I am trying to get the totals of a table by client by type of income. This query will get what I am looking for with each unique combination as a row: SELECT Sales.Client, BillCode.Type, Sum(Sales.Amount) FROM Invoice_Details INNER JOIN BillCode ON Sales.BillCode = BillCode.id GROUP BY Client, Type;
2
1581
by: Steven Taylor | last post by:
Hope someone can help. Table structure: Name : tbl_Runs Fields are: Run_ID Run_Date Run_Distance (km) Run_Duration (secs)
8
6077
by: Penny | last post by:
(Access 2003 Multiuser Split DB, Windows XP Pro) Hi All, I would really appreciate just some basic tips on how to make a Crosstab Form based on a Crosstab Query. The query always has the same number of records(generated from a table of predefined 'timeslots'). The number of columns(one for each Consultant) varies depending on how many of the Consultants have a yes/no field('Participates') set to yes. Therefore the Crosstab query...
4
1962
by: ringer | last post by:
I need help with a crosstab query. I would like the column headings to be the last 6 months, the row headings to be billers, and the data in the middle to be both the date that a payment was made (falling within the month headings) and also the amount paid in that payment. Sometimes there might be more than one payment to a biller in a month or there might be no payments to that biller in a month. All of the raw data needed is in one table. I...
2
3396
by: Jim Devenish | last post by:
I wish to create a crosstab query as the record source for a report. It needs to count data between selected dates which are entered by the user in a popup window. The following Select query works: SELECT Tasks.EnquirySourceID, Tasks.BusinessUnitID, Count(Tasks.TaskID) AS CountOfTaskID FROM Tasks WHERE (((Tasks.TaskDate)>=!!)) GROUP BY Tasks.EnquirySourceID, Tasks.BusinessUnitID;
0
8674
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9026
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2328
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.