I don't know how I've managed to do it, but I've messed up my SELECT query which is used by an append query.
I have two queries. The first is a simple query that contains the Pk from my main table [prospects] and a split_code query to take the first one or two digits of a postcode.
code:
SELECT prospects.ID, Left([pcode],[no of digits]) AS split_code
FROM prospects;
my second table then takes the text digit(s) and appends them to a postcode/territory table using the first query.
code:
INSERT INTO territory_lookup ( id, territory )
SELECT postcode_splitter.ID, postcode_territory_map.territory
FROM postcode_splitter INNER JOIN postcode_territory_map ON postcode_splitter.split_code = postcode_territory_map.postcode
WHERE (((postcode_territory_map.territory) Between [first territory] And [last territory]));
I designed it so that I could take the first two letters of the postcode and asign them to a territory. I could then take the postcodes who only use one letter to replace the ones with a letter and a number (from the 2 digit split) only problem is, the one digit splitter doesn't overwrite the 2 digit split and so I get two records.
help!
I have two queries. The first is a simple query that contains the Pk from my main table [prospects] and a split_code query to take the first one or two digits of a postcode.
code:
SELECT prospects.ID, Left([pcode],[no of digits]) AS split_code
FROM prospects;
my second table then takes the text digit(s) and appends them to a postcode/territory table using the first query.
code:
INSERT INTO territory_lookup ( id, territory )
SELECT postcode_splitter.ID, postcode_territory_map.territory
FROM postcode_splitter INNER JOIN postcode_territory_map ON postcode_splitter.split_code = postcode_territory_map.postcode
WHERE (((postcode_territory_map.territory) Between [first territory] And [last territory]));
I designed it so that I could take the first two letters of the postcode and asign them to a territory. I could then take the postcodes who only use one letter to replace the ones with a letter and a number (from the 2 digit split) only problem is, the one digit splitter doesn't overwrite the 2 digit split and so I get two records.
help!