G
Guest
When I do a cross tab query it gives me a null if a record does not exist.
How do I change the Null to 0
Thanks in advance
Trevor
How do I change the Null to 0
Thanks in advance
Trevor
Andibevan said:Unfortunately, due to the nature of my query I can't access the design
view
to try what you suggested.
I have therefore added "WHERE [Queryfour.Severity/Closure] IS NOT NULL"
but
this means that the first row is not displayed when there are no records
present.
Any ideas?
TRANSFORM NZ(Count(Queryfour.DefectID),0) AS CountOfDefectID
SELECT Intervals.Descr AS Range, Count(Queryfour.DefectID) AS Total
FROM Queryfour RIGHT JOIN Intervals ON (Queryfour.VarAge <=
Intervals.High)
AND (Queryfour.VarAge >= Intervals.Low)
WHERE [Queryfour.Severity/Closure] IS NOT NULL
GROUP BY Intervals.Descr
PIVOT [Queryfour.Severity/Closure];
Allen Browne said:The <> column represents null values.
You can remove them from the query by specifing:
Is Not Null
in the Criteria row under the Column Heading field.
Allen Browne said:The other option would be to add an IN to the Pivot clause, and list the
valid values, e.g.:
PIVOT [Queryfour.Severity/Closure] In (1,2,3,4);
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
Andibevan said:Unfortunately, due to the nature of my query I can't access the design
view
to try what you suggested.
I have therefore added "WHERE [Queryfour.Severity/Closure] IS NOT NULL"
but
this means that the first row is not displayed when there are no records
present.
Any ideas?
TRANSFORM NZ(Count(Queryfour.DefectID),0) AS CountOfDefectID
SELECT Intervals.Descr AS Range, Count(Queryfour.DefectID) AS Total
FROM Queryfour RIGHT JOIN Intervals ON (Queryfour.VarAge <=
Intervals.High)
AND (Queryfour.VarAge >= Intervals.Low)
WHERE [Queryfour.Severity/Closure] IS NOT NULL
GROUP BY Intervals.Descr
PIVOT [Queryfour.Severity/Closure];
Allen Browne said:The <> column represents null values.
You can remove them from the query by specifing:
Is Not Null
in the Criteria row under the Column Heading field.
I have the same problem but also need to know how to get rid of an extra
column that has a "<>" at the top of it.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.