This works for me as expected (Access 2003). Note that I am not using
"<>", but am using Null in the in clause. When I use null, the column
headinf of the result does show "<>"
TRANSFORM Count(Nominations.ID) AS CountOfID1
SELECT Nominations.ID, Count(Nominations.ID) AS CountOfID
FROM Nominations
GROUP BY Nominations.ID
PIVOT Nominations.NomineeName In ("Ted",Null);
And this works also
TRANSFORM Count(Nominations.ID) AS CountOfID1
SELECT Nominations.ID, Count(Nominations.ID) AS CountOfID
FROM Nominations
GROUP BY Nominations.ID
PIVOT NZ(Nominations.NomineeName, "N/A") In ("Ted","N/A");
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Lars said:
That should have been the following testresults:
Region TotalID_person <> Female Male
1 1 1
2 3 1 1
3 1 1
Lars
Lars Brownies said:
The full query:
TRANSFORM Count(ID_person) AS CountOfID_person
SELECT Region, Count(ID_person) AS [Total ID_person]
FROM tblPerson
GROUP BY Region
PIVOT Gender IN("<>","Female","Male");
which results in the following testresults
qryRegionGender Region Total ID_person <> Female Male
1 1
1
2 3
1 1
3 1
1
There is one person with region 2 and without a gender value, but it's
not shown in the table (total is 3 but you only see 1 for female and 1
for male). If I remove IN("<>","Female","Male") it works, but when there
is no missing value the <> field isn't there and I can't open my report.
Lars
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_gmail.com> schreef in
bericht I think it would depend on how the <> column is being generated.
What's the rest of your SQL statement?
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
I have a crosstab query in which null values result in a column called
<>. To make sure my report can be run, I've used the IN statement
(IN("<>","M","F")) to make sure the 3 fields are always there, even
when there is no null value.
Strange thing is that the M and F values are shown correctly but the
<> values don't show at all. The total value of all 3 fields does
include the null values of the <> field.
Any ideas what I'm doing wrong?
Thanks,
Lars