Post codes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that examines postcodes. For those of you not in the UK, this is an 8 character field. For example

GU21 1JN At the moment, I am using the left characters only. This is fine for

G
R
A

et

but I want to be able to lump city postcodes, for example

L
L
L

together, but retain the dual (town) postcodes.

I cannot think of a simple way to do this, can anyone help

:(
 
Nik:

You can use the Mid() function to pull the second value in the post code and
then use the IsNumeric() function to see if you've got a city or not. What
I'd do then is to create an alaised field where in you use those to tests in
an IIF statement to get your key field to group by.

Eg: PostGroup: IIF(IsNumeric(Mid([PostCode],2,1)),
Left([PostCode],1),Left([PostCode],2))

HTH
 
While on the subject of PostCodes
When I receive postcodes such as CF205PN or CF25PN how can it be split too
CF20 5PN and CF2 5PN
any thoughts Garry

Nik Hammond said:
I have a report that examines postcodes. For those of you not in the UK,
this is an 8 character field. For example:
 
Back
Top