Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Postcode Formula Help Post Reply Post New Topic
Author Message
Blesid
Newbie
Newbie
Avatar

Joined: 10 Jul 2007
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote Blesid Replybullet Topic: Postcode Formula Help
    Posted: 25 Jul 2007 at 1:15am

Hi,

I want to return everything up to and including, the first letter of the second half of UK postcodes. They take the form "BN2 6DE" or "DN28 7YT". As you can see the first section can be either three or four characters. What I am looking for is a formula that locates the space in the string and then returns the adjacent character and everything preceding and including the space.

The Postcodes are stored in {T_OrderHeader.ShipPostcode}.

I had tried removing the space and returning a set number of digits but this still leaves me with extra data as the first section can be either 3 or four characters.

Please can anyone help? You will be saving me a lot of time manually adjusting entries in Excel!

IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 25 Jul 2007 at 7:29am
If the last part of the postcode is always three charaters you could try a revStr function and start from the end of the string and move backwards through it.
 
You could also get the length of the string and then parse out all but the characters you want.
 
Look under Functions in the Index for CR Help. It should give you everything you need including samples. If you still have trouble let us know. So there is no doubt you should give us a sample of what you returned for the report so we can create the correct syntax.
 
Hope this helps
 
Regards,
 
John W.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.