S
Smartin
Just a curiosity...
Of course we are all used to hand-typed queries being rearranged once
saved. Parenthesis are added to excess, aliases are sometimes created,
etc.
What I'm talking about is a SQL statement that is rearranged by Jet
(Access?) /every/ time it is saved. Here's an example:
I saved the following SQL:
SELECT C.ID INTO PYR_EXCLUDE
FROM CAT_PYR AS C INNER JOIN EXCLUSION_RULES AS E ON
((C.DESK_COD LIKE E.DESK_COD & "*") AND
(C.CLM_NUM LIKE E.CLM_NUM & "*") AND
(C.ACC_NUM LIKE E.ACC_NUM & "*") AND
(C.MED_ONLY LIKE E.MED_ONLY & "*"));
Reopen the query design and you have:
SELECT C.ID INTO PYR_EXCLUDE
FROM CAT_PYR AS C INNER JOIN EXCLUSION_RULES AS E ON (C.DESK_COD LIKE
E.DESK_COD & "*") AND
(C.CLM_NUM LIKE E.CLM_NUM & "*") AND
(C.ACC_NUM LIKE E.ACC_NUM & "*") AND
(C.MED_ONLY LIKE E.MED_ONLY & "*");
Of course, I expect such changes after the first save. But, save this
again and reopen the query design and you have:
SELECT C.ID INTO PYR_EXCLUDE
FROM CAT_PYR AS C INNER JOIN EXCLUSION_RULES AS E ON (C.MED_ONLY LIKE
E.MED_ONLY & "*") AND (C.ACC_NUM LIKE E.ACC_NUM & "*") AND (C.CLM_NUM
LIKE E.CLM_NUM & "*") AND (C.DESK_COD LIKE E.DESK_COD & "*");
Save and reopen yet again and you have:
SELECT C.ID INTO PYR_EXCLUDE
FROM CAT_PYR AS C INNER JOIN EXCLUSION_RULES AS E ON (C.DESK_COD LIKE
E.DESK_COD & "*") AND (C.CLM_NUM LIKE E.CLM_NUM & "*") AND (C.ACC_NUM
LIKE E.ACC_NUM & "*") AND (C.MED_ONLY LIKE E.MED_ONLY & "*");
Continue this ad infinitum and the SQL will alternate between the last
two versions above. Strange!
I've never seen this before. FWIW this is the first time I've used so
many unconventional join operations.
Of course we are all used to hand-typed queries being rearranged once
saved. Parenthesis are added to excess, aliases are sometimes created,
etc.
What I'm talking about is a SQL statement that is rearranged by Jet
(Access?) /every/ time it is saved. Here's an example:
I saved the following SQL:
SELECT C.ID INTO PYR_EXCLUDE
FROM CAT_PYR AS C INNER JOIN EXCLUSION_RULES AS E ON
((C.DESK_COD LIKE E.DESK_COD & "*") AND
(C.CLM_NUM LIKE E.CLM_NUM & "*") AND
(C.ACC_NUM LIKE E.ACC_NUM & "*") AND
(C.MED_ONLY LIKE E.MED_ONLY & "*"));
Reopen the query design and you have:
SELECT C.ID INTO PYR_EXCLUDE
FROM CAT_PYR AS C INNER JOIN EXCLUSION_RULES AS E ON (C.DESK_COD LIKE
E.DESK_COD & "*") AND
(C.CLM_NUM LIKE E.CLM_NUM & "*") AND
(C.ACC_NUM LIKE E.ACC_NUM & "*") AND
(C.MED_ONLY LIKE E.MED_ONLY & "*");
Of course, I expect such changes after the first save. But, save this
again and reopen the query design and you have:
SELECT C.ID INTO PYR_EXCLUDE
FROM CAT_PYR AS C INNER JOIN EXCLUSION_RULES AS E ON (C.MED_ONLY LIKE
E.MED_ONLY & "*") AND (C.ACC_NUM LIKE E.ACC_NUM & "*") AND (C.CLM_NUM
LIKE E.CLM_NUM & "*") AND (C.DESK_COD LIKE E.DESK_COD & "*");
Save and reopen yet again and you have:
SELECT C.ID INTO PYR_EXCLUDE
FROM CAT_PYR AS C INNER JOIN EXCLUSION_RULES AS E ON (C.DESK_COD LIKE
E.DESK_COD & "*") AND (C.CLM_NUM LIKE E.CLM_NUM & "*") AND (C.ACC_NUM
LIKE E.ACC_NUM & "*") AND (C.MED_ONLY LIKE E.MED_ONLY & "*");
Continue this ad infinitum and the SQL will alternate between the last
two versions above. Strange!
I've never seen this before. FWIW this is the first time I've used so
many unconventional join operations.