473,396 Members | 2,109 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,396 software developers and data experts.

Crosstab chart does not recognize field name as valid.

2
I have a chart based on a crosstab query of SectionName versus Status where Status is Open, Ready for Closure, or Closed. The problem is that when there are no SectionNames at status Ready for Closure, I get errors and my chart is blank. I understand the problem but I'm not a programmer and don't know how to fix it. It seems like an IIF statement around the Row Source SELECT phrase "Sum(ctbStatusBySection.[Ready for Closure]) AS [Ready for Closure]" would fix it, but I don't know the correct syntax.

Here is the SQL Code from the crosstab query:

TRANSFORM Count(qryAllTPRsWithoutReplacedPartsData.prob_stat us_text) AS [Count]
SELECT qryAllTPRsWithoutReplacedPartsData.SectionName, Count(qryAllTPRsWithoutReplacedPartsData.prob_stat us) AS Total
FROM qryAllTPRsWithoutReplacedPartsData
GROUP BY qryAllTPRsWithoutReplacedPartsData.SectionName
ORDER BY qryAllTPRsWithoutReplacedPartsData.SectionName
PIVOT qryAllTPRsWithoutReplacedPartsData.prob_status_tex t;

Here is the Row Source from the chart:

SELECT ctbStatusBySection.SectionName, Sum(ctbStatusBySection.Open) AS Open, Sum(ctbStatusBySection.[Ready for Closure]) AS [Ready for Closure], Sum(ctbStatusBySection.Closed) AS Closed FROM ctbStatusBySection GROUP BY ctbStatusBySection.SectionName ORDER BY Sum(ctbStatusBySection.Open) DESC , Sum(ctbStatusBySection.[Ready for Closure]) DESC , Sum(ctbStatusBySection.Closed) DESC;
Apr 10 '07 #1
3 2253
Denburt
1,356 Expert 1GB
Typing off the cuff here but try this:

Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Count(qryAllTPRsWithoutReplacedPartsData.prob_stat us_text) AS [Count]
  2. SELECT iif(Isnull(qryAllTPRsWithoutReplacedPartsData.SectionName),"No Section Name",qryAllTPRsWithoutReplacedPartsData.SectionName), Count(qryAllTPRsWithoutReplacedPartsData.prob_status) AS Total
  3. FROM qryAllTPRsWithoutReplacedPartsData
  4. GROUP BY iif(Isnull(qryAllTPRsWithoutReplacedPartsData.SectionName),"No Section Name",qryAllTPRsWithoutReplacedPartsData.SectionName) ORDER BY  iif(Isnull(qryAllTPRsWithoutReplacedPartsData.SectionName),"No Section Name",qryAllTPRsWithoutReplacedPartsData.SectionName)
  5. PIVOT qryAllTPRsWithoutReplacedPartsData.prob_status_text;
  6.  
Essentially checking SectionName every time to make sure something is entered into that field as such.

iif(Isnull(qryAllTPRsWithoutReplacedPartsData.Sect ionName),"No Section Name",qryAllTPRsWithoutReplacedPartsData.SectionNa me)
Apr 12 '07 #2
kc5
2
Thanks Denburt, but that didn't work.I got help from a cotract programmer in Cincinnati (my son-in-law) and here is what he figured out:

Basically he created a new table of all the status codes and LEFT JOINed on the status code in my table.

tblProblemStatus
status_id status_text
1 Open
2 Closed
5 Ready for Closure

Crosstab Query:
TRANSFORM Count(qryAllTPRsWithoutReplacedPartsData.prob_stat us_text) AS [Count]
SELECT qryAllTPRsWithoutReplacedPartsData.SectionName, Count(qryAllTPRsWithoutReplacedPartsData.prob_stat us) AS Total
FROM tblProblemStatus LEFT JOIN qryAllTPRsWithoutReplacedPartsData ON tblProblemStatus.status_id = qryAllTPRsWithoutReplacedPartsData.prob_status
GROUP BY qryAllTPRsWithoutReplacedPartsData.SectionName
ORDER BY qryAllTPRsWithoutReplacedPartsData.SectionName
PIVOT tblProblemStatus.status_text;
Apr 19 '07 #3
Denburt
1,356 Expert 1GB
Cool glad you had the resources and he managed to get you rolling. Thanks for letting us know.
Apr 19 '07 #4

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

Similar topics

3
by: DFS | last post by:
I've been working around this for years (I believe), so I figured someone here might know: Why won't a crosstab query accept a value from a form reference? TRANSFORM...
4
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...
1
by: mtech1 | last post by:
Access 2002 I am trying to create a dynamic crosstab report that parameters come from 3 different forms. I get runtime error 3070 - The Microsoft Jet database engine does not recognize...
0
by: KemperR | last post by:
Dear All, I have a very hard time with an ACCESS 2000 crosstab query. The basic query the crosstab is based on looks like this: SELECT DokumenteNachNummer.Dokumente_ID ,...
0
by: Heather | last post by:
I am trying to create a new report using a chart wizard with Access 97. When I try to use the Safety Audit Date as a field. I do have a Parameter Value set on this field. Between And The...
2
by: scott.k.fraley | last post by:
....and the SELECT thats trying to pull from said Query doesn't like it one bit! ;) I'm working on this project (in Access 2002) and there is a report who's RecordSource is the following...
6
by: tizmagik | last post by:
I am having a lot of difficulty generating a CrossTab Query based report. I have looked online for several tutorials and whatnot but I have not been able to really find what I'm looking for, nor...
0
by: carl_birchall | last post by:
I would really appreciate a nudge in the right direction on how to resolve this issue, as despite checking previous listings still not getting anywhere. I have 4 tables tblApplicant_Person...
2
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...
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...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.