Concatenate? Trim?

FlyGuyTray

Registered User.
Local time
Today, 08:22
Joined
Nov 30, 2010
Messages
38
I am trying to drop the last 6 characters in a column... for example:

I would like to make this:
123456-123456_12345

This:
123456-123456

i tried using "concatenate(Right(A1,6))" in excel but that returned the last 6 characters and trim did the same.

Could someone point me in the right direction to complete this in access or excel? bit of a novice..
 
Is there a reason that something as simple as the following would not give you what you want?

LEFT(A1, LEN(A1)-6)

NOTE: You might need to test that LEN(A1) is actually >6 to prevent an error in NULL or short fields.
 
Last edited:
I don't really use Excel, but try this:

Code:
Left(A1,Len(A1)-6)

That should start at the left-most character and return all the characters except the last 6 (as it's based on length it will work no matter how many characters are in A1).
 
How about using Left() Function in Access.

The Left function extracts a substring from a string, starting from the left-most character.

The syntax for the Left function is: Left (text, number_of_characters)

Text is the string that you wish to extract from.

Number_of_characters indicates the number of characters that you wish to extract starting from the left-most character.

For example:

Left ("Tech on the Net", 4) would return "Tech"
Left ("Alphabet Soup", 5) would return "Alpha"


VBA Code

The Left function can be used in VBA code. For example:

Dim LResult As String

LResult = Left ("Alphabet",3)

The variable LResult would now contain the value of "Alp".

Catalina
 

Users who are viewing this thread

Back
Top Bottom