Function LEFT

Sniperbooya

Registered User.
Local time
Today, 12:24
Joined
Jan 30, 2015
Messages
16
Good Morning everyone,

I have got a question regarding Access' function: LEFT()

I have got a record in the query named 'KernelNumber'.

Kernelnumber
01A
01B
02A
02B
03A
03B

What i would like to do is split the '01' from the 'A' and the 'B'

Luckily i remembered there was a function called LEFT() which allows you to do so:

Code:
test : Left([Kernelnumber],2)

which works just fine.

BUT, only if kernelnumber <= 99A.

I was wondering if it was possible to say: Take everything to the left of "A" and "B" without specifically stating the number of characters?

So that it wont be a problem if there is a kernelnumber of 101A..
 
If the part you want on the left is always numeric you could use:

Val([Kernel Number])

However it does cause problems if the letter is N or E and is followed by more digits as this would be interpreted as exponential notation.
 
Thanks, ill give it a shot.

Only the letters A and B will be used so that wouldnt be a problem.

Thanks again.
 
Other Functions worthy of consideration are

Right(YourString, 1) will get the last character

Left(Len(YourString) - 1) will get all but the last character

-- Rookie
 

Users who are viewing this thread

Back
Top Bottom