View Full Version : SQL CrossTab Query


aftabn10
01-19-2009, 05:21 AM
Hi, I was wondering if somebody could help me. I have wrote the following query.

TRANSFORM Count(daily_effectiveness.JOBTIME) AS CountOfJOBTIME,
TRANSFORM Sum(daily_effectiveness.JOBTIME) AS SumOfJOBTIME
SELECT daily_effectiveness.EIN, Count(daily_effectiveness.JOBTIME) AS [Total Agent Work], Sum(daily_effectiveness.JOBTIME) AS [Total Time]
FROM daily_effectiveness
GROUP BY daily_effectiveness.EIN
PIVOT daily_effectiveness.ORBITQUEUE;

and when clicking on Datasheet i then get the following error:

"SYNTAX ERROR IN TRANSFORM STATEMENT"

I think this has something to do with the transform line, but i would like to display both a count and a sum.

Please if somebody could help. Thanks in advance.

namliam
01-19-2009, 06:07 AM
You cannot do both count and sum in a transform

aftabn10
01-19-2009, 06:09 AM
Thanks for your reply, Is their any way I can have a sum and count together?