Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: UK postcode Area Post Reply Post New Topic
Author Message
dibblejon
Newbie
Newbie


Joined: 05 Jan 2011
Location: United Kingdom
Online Status: Offline
Posts: 32
Quote dibblejon Replybullet Topic: UK postcode Area
     Posted: 15 Dec 2011 at 11:49pm
Hi

I need to extract the first alpha characters only from a UK postcode in my table.

Eg. AB14 1JZ

Need : AB

Eg. RH1 4JJ

Need. RH

etc.....

Any ideas how I can do this?

Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Dec 2011 at 8:28am
Left(table.postcode,2)
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 20 Dec 2011 at 3:46am

UK postcodes don't always have 2 letters at the front,
bigger towns (like Birmingham) only have one.

What is needed is

If  NumericText(mid(table.postcode,2,1)) then (Left(table.postcode,1)
else
Left(table.postcode,2)

IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum