M
mark
I have a table of UK companies whose records I want to filter using a
map of postcode regions.
For the benfit of people outside the UK, our postcodes are a pain to
work with because they are not a standard length, and the part which
identifies the region isn't a standard length either.
The first letters of the postcode denotes a general region, and then
sub-regions are denoted by the following numbers and letters.
Thus a valid postcode could be
GL24 6TY
G1 4TH
Which means you can't simply Trim Left to the first two characters and
then filter the results on a region code of, say "G", because you would
be returning results from Glasgow and Gloucester.
If I can express each postcode in my table as a region (that is, the
first letters of the postcode only), I could then filter this query
using variables passed from my map (the variables will simply be the
postcode region letters, eg. G, L, M, PL, ME.
To do this I guess I need to take everything from the first occurrence
of a number in my postcode and get rid of it.
Is there a way of using the Replace function in an Access query to do
this?
map of postcode regions.
For the benfit of people outside the UK, our postcodes are a pain to
work with because they are not a standard length, and the part which
identifies the region isn't a standard length either.
The first letters of the postcode denotes a general region, and then
sub-regions are denoted by the following numbers and letters.
Thus a valid postcode could be
GL24 6TY
G1 4TH
Which means you can't simply Trim Left to the first two characters and
then filter the results on a region code of, say "G", because you would
be returning results from Glasgow and Gloucester.
If I can express each postcode in my table as a region (that is, the
first letters of the postcode only), I could then filter this query
using variables passed from my map (the variables will simply be the
postcode region letters, eg. G, L, M, PL, ME.
To do this I guess I need to take everything from the first occurrence
of a number in my postcode and get rid of it.
Is there a way of using the Replace function in an Access query to do
this?