Post Code Query

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

in my customers table i have the post code stored.
I would like to run a query that will only display the last 3 charaters
of the post code

Eg.

Post code in Customer table 'BS12 8HJ'
in the query i would like it to display '8HJ'


Can any one help thanks

Simon
 
Add a computed field to the query that uses the Right function:

Right([PostCode], 3)
 
Simon said:
I would like to run a query that will only display the last 3 charaters
of the post code

Eg.

Post code in Customer table 'BS12 8HJ'
in the query i would like it to display '8HJ'

Do you allow just the Outward code (e.g. 'BS12') to be stored? Do you
validate for a single space separating the Outward and Inward codes?

IIF(INSTR(1, IIF(postcode IS NULL, '', postcode), ' ') = 0, NULL,
MID(postcode, INSTR(1, postcode, ' ') + 1))

Also see:

http://groups.google.co.uk/group/microsoft.public.access.formscoding/msg/fa9e83bb54a4f37f?hl=en&

Jamie.

--
 
Back
Top