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(ctbStatusB ySection.[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(qryAllTPR sWithoutReplace dPartsData.prob _status_text) AS [Count]
SELECT qryAllTPRsWitho utReplacedParts Data.SectionNam e, Count(qryAllTPR sWithoutReplace dPartsData.prob _status) AS Total
FROM qryAllTPRsWitho utReplacedParts Data
GROUP BY qryAllTPRsWitho utReplacedParts Data.SectionNam e
ORDER BY qryAllTPRsWitho utReplacedParts Data.SectionNam e
PIVOT qryAllTPRsWitho utReplacedParts Data.prob_statu s_text;
Here is the Row Source from the chart:
SELECT ctbStatusBySect ion.SectionName , Sum(ctbStatusBy Section.Open) AS Open, Sum(ctbStatusBy Section.[Ready for Closure]) AS [Ready for Closure], Sum(ctbStatusBy Section.Closed) AS Closed FROM ctbStatusBySect ion GROUP BY ctbStatusBySect ion.SectionName ORDER BY Sum(ctbStatusBy Section.Open) DESC , Sum(ctbStatusBy Section.[Ready for Closure]) DESC , Sum(ctbStatusBy Section.Closed) DESC;
Here is the SQL Code from the crosstab query:
TRANSFORM Count(qryAllTPR sWithoutReplace dPartsData.prob _status_text) AS [Count]
SELECT qryAllTPRsWitho utReplacedParts Data.SectionNam e, Count(qryAllTPR sWithoutReplace dPartsData.prob _status) AS Total
FROM qryAllTPRsWitho utReplacedParts Data
GROUP BY qryAllTPRsWitho utReplacedParts Data.SectionNam e
ORDER BY qryAllTPRsWitho utReplacedParts Data.SectionNam e
PIVOT qryAllTPRsWitho utReplacedParts Data.prob_statu s_text;
Here is the Row Source from the chart:
SELECT ctbStatusBySect ion.SectionName , Sum(ctbStatusBy Section.Open) AS Open, Sum(ctbStatusBy Section.[Ready for Closure]) AS [Ready for Closure], Sum(ctbStatusBy Section.Closed) AS Closed FROM ctbStatusBySect ion GROUP BY ctbStatusBySect ion.SectionName ORDER BY Sum(ctbStatusBy Section.Open) DESC , Sum(ctbStatusBy Section.[Ready for Closure]) DESC , Sum(ctbStatusBy Section.Closed) DESC;
Comment