Hi,
I am trying to develop a data model in MySQL using SQL code taken directly from an MS Access database (where it works fine). The Access version is 2002 with SP-2 in Windows XP and the MySQL version is 4.0.18-nt.
Problem is, the query routines (which are unaltered Access-generated SQL) don't work in MySQL. I am using two types of pre-existing tables for these proceedures, ones prefixed with 'Data_' contain data and ones prefixed with 'Run_' which are initially blank and intended for use as temporary batch tables to be filled as the proceedure runs.
The model is built around queries such as the following:
SELECT Data_AllPosterData.PSG, Count(Data_AllPosterData.ID) AS GrossOTS, Sum(Data_AllPosterData.Visibility) AS NetOTS, Sum(Data_AllPosterData.Invisibility) AS Invisibility INTO Run_ActivePSGs
FROM Data_AllPosterData INNER JOIN Data_TestPacks ON Data_AllPosterData.PosterID = Data_TestPacks.PosterID
WHERE (((Data_TestPacks.TestPackID)=632))
GROUP BY Data_AllPosterData.PSG
HAVING (((Sum(Data_AllPosterData.Visibility)) Is Not Null Or (Sum(Data_AllPosterData.Visibility))<>0));
However, for every one of the routines, the error message is:
"ERROR 1064: You have and error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Run_ActivePSGs FROM Data_AllPosterData INNER JOIN Data_TestPac"
As these routines work fine in Access, the tables they relate to exist in the MySQL database and have the correct fields/data types defined, I am at a loss to explain this. There is nothing in the manual relating to this error in this form.
Please Help!!!!
I am trying to develop a data model in MySQL using SQL code taken directly from an MS Access database (where it works fine). The Access version is 2002 with SP-2 in Windows XP and the MySQL version is 4.0.18-nt.
Problem is, the query routines (which are unaltered Access-generated SQL) don't work in MySQL. I am using two types of pre-existing tables for these proceedures, ones prefixed with 'Data_' contain data and ones prefixed with 'Run_' which are initially blank and intended for use as temporary batch tables to be filled as the proceedure runs.
The model is built around queries such as the following:
SELECT Data_AllPosterData.PSG, Count(Data_AllPosterData.ID) AS GrossOTS, Sum(Data_AllPosterData.Visibility) AS NetOTS, Sum(Data_AllPosterData.Invisibility) AS Invisibility INTO Run_ActivePSGs
FROM Data_AllPosterData INNER JOIN Data_TestPacks ON Data_AllPosterData.PosterID = Data_TestPacks.PosterID
WHERE (((Data_TestPacks.TestPackID)=632))
GROUP BY Data_AllPosterData.PSG
HAVING (((Sum(Data_AllPosterData.Visibility)) Is Not Null Or (Sum(Data_AllPosterData.Visibility))<>0));
However, for every one of the routines, the error message is:
"ERROR 1064: You have and error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Run_ActivePSGs FROM Data_AllPosterData INNER JOIN Data_TestPac"
As these routines work fine in Access, the tables they relate to exist in the MySQL database and have the correct fields/data types defined, I am at a loss to explain this. There is nothing in the manual relating to this error in this form.
Please Help!!!!