Removing "As" Clauses

D

dandydan9

When I try to delete the following "As" cluases from the query below
and save, Access reintroduces the "As" clauses.

INSERT INTO TGR_recharge_MIDTID
SELECT DISTINCT (a.pps_loc_id)*1 AS RECHARGE_MIDTID_ID

, a.pps_loc_id AS pps_loc_id

, midtid AS midtid

FROM WHSETL_LOCATIONS_MIDTID_MV AS a, whsetl_locations_mv AS b
WHERE cust_name In ('Kwik Trip','PREPAID SOLUTIONS IDT') And midtid Is Not
Null and a.pps_loc_id = b.pps_loc_id and not exists (select 1 from
tgr_recharge_midtid b where b.midtid=a.midtid)
ORDER BY 2, 1;


The "As" clauses cause the query to fail with a circular reference.
 
B

Bob Barrows [MVP]

dandydan9 said:
When I try to delete the following "As" cluases from the query below
and save, Access reintroduces the "As" clauses.

INSERT INTO TGR_recharge_MIDTID
SELECT DISTINCT (a.pps_loc_id)*1 AS RECHARGE_MIDTID_ID

, a.pps_loc_id AS pps_loc_id

, midtid AS midtid

FROM WHSETL_LOCATIONS_MIDTID_MV AS a, whsetl_locations_mv AS b
WHERE cust_name In ('Kwik Trip','PREPAID SOLUTIONS IDT') And midtid
Is Not Null and a.pps_loc_id = b.pps_loc_id and not exists (select 1
from tgr_recharge_midtid b where b.midtid=a.midtid)
ORDER BY 2, 1;


The "As" clauses cause the query to fail with a circular reference.

Show us what you are attempting to change it to ... I assume you are
editing the sql in your attempt to remove the aliases ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top