Help with a CrossTab Query

E

Eric

TRANSFORM IIf([Manufactured]>0,"X",Null) AS Expr1
SELECT dbo_PlantProduct.ProductCode
FROM dbo_Plant INNER JOIN dbo_PlantProduct ON dbo_Plant.Code =
dbo_PlantProduct.PlantCode
GROUP BY dbo_PlantProduct.ProductCode
PIVOT dbo_Plant.Name;

With the above query I get that the query canot execute because of a
aggragate function. Any ideas on what I am doing wrong?
 
D

Duane Hookom

Your transformed/Value expression needs Min, Max, First, Last, Sum,... or
whatever
TRANSFORM Min(IIf([Manufactured]>0,"X",Null)) AS Expr1
SELECT dbo_PlantProduct.ProductCode
FROM dbo_Plant INNER JOIN dbo_PlantProduct ON dbo_Plant.Code =
dbo_PlantProduct.PlantCode
GROUP BY dbo_PlantProduct.ProductCode
PIVOT dbo_Plant.Name;
 
E

Eric

SWEET! Thank you! I was going nuts!

Duane Hookom said:
Your transformed/Value expression needs Min, Max, First, Last, Sum,... or
whatever
TRANSFORM Min(IIf([Manufactured]>0,"X",Null)) AS Expr1
SELECT dbo_PlantProduct.ProductCode
FROM dbo_Plant INNER JOIN dbo_PlantProduct ON dbo_Plant.Code =
dbo_PlantProduct.PlantCode
GROUP BY dbo_PlantProduct.ProductCode
PIVOT dbo_Plant.Name;

--
Duane Hookom
MS Access MVP
--

Eric said:
TRANSFORM IIf([Manufactured]>0,"X",Null) AS Expr1
SELECT dbo_PlantProduct.ProductCode
FROM dbo_Plant INNER JOIN dbo_PlantProduct ON dbo_Plant.Code =
dbo_PlantProduct.PlantCode
GROUP BY dbo_PlantProduct.ProductCode
PIVOT dbo_Plant.Name;

With the above query I get that the query canot execute because of a
aggragate function. Any ideas on what I am doing wrong?
 
Top