MySQL Forums
Forum List  »  Microsoft Access

Migrating MS Access queries to MySQL
Posted by: Fabian Hess
Date: May 31, 2005 07:02AM

Hi,

I'm currently migrating an Access application to MySQL. Migrating the data itself is no problem, but I have 270 queries to migrate. In MS Access there are some functions that cannot be used 1:1 in MySQL, so it seems like I have to rewrite all the queries. Or is there a tool available that would help me?



Example: MS Access SQL

---------------------------------------------------------------------------------

SELECT
ANGPOS.T$QONO, ANGPOS.T$PONO, KUNDEN.T$CUNO, ANGKOPF.T$CBRN, BRANCH.T$DSCA,
IIf([AUFKOPF].[T$CBRN]<=" 1200","Holz",
IIf([AUFKOPF].[T$CBRN]>=" 1201" And [AUFKOPF].[T$CBRN]<=" 1203","Türen + Fenster",
IIf([AUFKOPF].[T$CBRN]=" 1210","Treppen",
IIf([AUFKOPF].[T$CBRN]>=" 2000" And [AUFKOPF].[T$CBRN]<=" 2999","Kunststoff",
IIf([AUFKOPF].[T$CBRN]>=" 3000" And [AUFKOPF].[T$CBRN]<=" 3999","Alu","Sonstige")))))

AS
OBranch, KUNDEN.T$NAMA, ANGPOS.T$ITEM, ARTIKEL.T$DSCA, ARTGRP.T$CITG, ARTGRP.T$DSCA,
LAND.T$CCTY, LAND.T$DSCA, ANGKOPF.T$RATS, ANGPOS.T$AMTA,
[ANGKOPF].[T$RATS]*[T$AMTA] AS Betrag, ANGKOPF.T$QDAT,
Format([ANGKOPF].[T$QDAT],"mm\/yyyy") AS Monat

FROM
(((((
ANGPOS
INNER JOIN ANGKOPF ON ANGPOS.T$QONO = ANGKOPF.T$QONO)
INNER JOIN KUNDEN ON ANGPOS.T$CUNO = KUNDEN.T$CUNO)
INNER JOIN LAND ON ANGKOPF.T$CCTY = LAND.T$CCTY)
INNER JOIN ARTIKEL ON ANGPOS.T$ITEM = ARTIKEL.T$ITEM)
INNER JOIN ARTGRP ON ARTIKEL.T$CITG = ARTGRP.T$CITG)
INNER JOIN BRANCH ON ANGKOPF.T$CBRN = BRANCH.T$CBRN

WHERE ((
(ANGPOS.T$QONO)>200000 And
(ANGPOS.T$QONO)<299999) AND
((ANGPOS.T$PONO)<900) AND
((ANGKOPF.T$QDAT)>#12/31/1999# And
(ANGKOPF.T$QDAT)<#1/1/2001#
))

ORDER BY ANGPOS.T$PONO DESC;

---------------------------------------------------------------------------------
Fabian

Options: ReplyQuote


Subject
Views
Written By
Posted
Migrating MS Access queries to MySQL
2314
May 31, 2005 07:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.