Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Right Issue 2

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
969
0
16
GB
Hi

I have a formula that takes the right characters of a block of text from a field.

RIGHT ({OrderHeader.DeliveryAddress},7)

If the text at the end is WR14 3PP it is bringing in R14 3PP.

If I change the formula to
RIGHT ({OrderHeader.DeliveryAddress},8)

It does not display them as it appears to be putting in a return in the result. I made the formula result field to Can Grow and this then shows them put puts a blank space above the result so throws all the alignment out.

Is there anything I can out in the formula so it prevent it creating carriage return or whatever it is it is doing and just show the result as expected.

Thanks
 
Try:

Code:
RIGHT(Replace({OrderHeader.DeliveryAddress},CHR(10),''),8)

If this doesn't work, replace CHR(10) with CHR(13) - one is a 'carriage return' and one is 'line feed'. There are other characters that have the same result but these seem to be the most commom.

Hope this helps.

Cheers
Pete
 
Hi

Thanks for the reply. I now have my code like below. If I keep it at 7, it shows the majority of the postcode but in some cases it leaves the leading character

So for example it shows a post code of OX5 1JD
But the one below if does not show the W in WR14 3PP

When using 8 it seems to grab then displays WR14 3PP but the OX5 1JD it appears to put a carriage return in and does not show the code due to this reason.

RIGHT(Replace({OrderHeader.DeliveryAddress},CHR(10),''),8)

Any more ideas please would be great.

Thanks
 
Try doing the replace after the Right 8

Replace(RIGHT({OrderHeader.DeliveryAddress},8),CHR(10),'')

Ian
 
Hi Ian

That appears to have worked, thanks to all for the help appreciated.
 
Hi

I have come across a new part to this issue which I am not sure if there is a solution

Some of the text we have noticed as extra spaces in the PostCode, example below. Is there way I can also include extra spaces, so just the Postcode shows, no matter how many spaces.
This code works fin Replace(RIGHT({OrderHeader.DeliveryAddress},8),CHR(10),'') but when the extra space appears it does not show the rest. Thanks


DN15 8TR
 
Not sure what you mean by extra space. Copied and pasted your sample post code and there was only one space between 15 and 8

What space are you referring too.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top