Seperation of Numbers and Text from alphanumeric string

rramkrishna

New member
Local time
Today, 08:59
Joined
Jun 7, 2013
Messages
6
Hi,

Can any one hlp me MS-Access VBA code to seperate numbers and string from an alphanumeric string.

Example:

Source: 598790abcdef2T
Output Required: 598790

Source: 5789065432abcdefghijklT
Output Required: 5789065432

Please help, I am using MS Access 2007

Thanks
Ram
 
Have you checked out VAL() ?

Thanks
 
Yes I had checked, this function doesn't thre at MS-Access.
 
What do you mean the Function doesn't there?? Val is a valid function..
Code:
? Val("5789065432abcdefghijklT")
 5789065432 
? Val("598790abcdef2T")
 598790
 
I am sorry, the function is available, however when I used the same in a query the result is showing as 0
 
its a update query to col1 data to col2

val([tabl1]!col1)

all my data in the above format in column 1 I would like to update in column 2 1st part of numbers
 
Have you tried

val([tabl1]![col1])
 
This should be your UPDATE Query..
Code:
UPDATE tableName SET tableName.secondColumn = Val(tableName.firstColumn);
 
posted over!

Can you confirm your data is as expected - i.e. col1 starts with numeric characters

Also perhaps post the whole query SQL, there may be an issue elsewhere
 
Thanks Paul, the query worked and got the output desired.

Thanks again for your help.
 

Users who are viewing this thread

Back
Top Bottom