473,699 Members | 2,514 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 3026
"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
17666
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
2913
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
8617
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
9174
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
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...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5875
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
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.