Reducing a string by a set amount of characters

  • Thread starter Thread starter AJCB
  • Start date Start date
A

AJCB

Hi,

I have Office 2007 and I am trying to get a variable length field:

APETREG050550 or
AFORMFGREG050550

to read:

APETREG050 or
AFORMFGREG050

Basically taking off the last 3 digits?

Is this possible?

Regards
AJ
 
Hi,

I have Office 2007 and I am trying to get a variable length field:

APETREG050550 or
AFORMFGREG050550

to read:

APETREG050 or
AFORMFGREG050

Basically taking off the last 3 digits?

Is this possible?

Regards
AJ

=Left([FieldName],Len([FieldName])-3)
 
AJCB,

Use the Right(string,length).

In your case.

Dim stemp as string

stemp = "APETREG050550"
stemp = Right(stemp,3)

Hope this helps.
 
Hi.

Thanks for this. It worked just how I wanted it.

AJ

fredg said:
Hi,

I have Office 2007 and I am trying to get a variable length field:

APETREG050550 or
AFORMFGREG050550

to read:

APETREG050 or
AFORMFGREG050

Basically taking off the last 3 digits?

Is this possible?

Regards
AJ

=Left([FieldName],Len([FieldName])-3)
 
Hi Martin,

If I do this it only shows the last 3 digits, whereas I wanted to take off
the last 3 digits and only show the rest.

Fred's suggestion worked though. Thanks anyway.

AJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top