×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Right Issue
2

Right Issue

Right Issue

(OP)
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

RE: Right Issue

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

RE: Right Issue

(OP)
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

RE: Right Issue

Try doing the replace after the Right 8

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

Ian

RE: Right Issue

(OP)
Hi Ian

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

RE: Right Issue

(OP)
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

RE: Right Issue

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close