Converting a crosstab query...

Converting a crosstab query...

am 22.03.2005 22:59:15 von Peter Crosby

------=_NextPart_000_0009_01C52F00.7B00C280
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Good afternoon,

I'm trying to convert some Access queries into MySQL usable format. I have
several of what Access call "cross tab queries", one of which look like this
in Access' sql dialect.


TRANSFORM Count(`Bulk Sample Query`.VendorSampleID) AS CountOfVendorSampleID
SELECT `Bulk Sample Query`.LabID, Count(`Bulk Sample
Query`.`AsbestosResult1%`) AS `Total Of AsbestosResult1%`
FROM `Bulk Sample Query`
GROUP BY `Bulk Sample Query`.LabID
PIVOT `Bulk Sample Query`.OrgID;

MySQL is less then pleased with this, returning the following error:

"Database error # 1064. You have an error in your SQL syntax. Check the
manual that corresponds to your MySQL server version for the right syntax to
use near 'TRANSFORM Count(`Bulk Sample Query`.VendorSampleID) AS CountOfV"

Any thoughts on how I can do this?

Thanks,
Peter




Peter Crosby CIH, CSP, CHMM
Exposure Assessment Strategies, Inc.
www.eastrat.com
973-655-0145

"Protecting Your Most Important Assets..."



------=_NextPart_000_0009_01C52F00.7B00C280--