Removing the '10' from '10477899' for thousands of records

morlan

Registered User.
Local time
Today, 11:39
Joined
Apr 23, 2003
Messages
143
I have thousands of records and in one field all codes start with 10.... I need to remove the '10' from all records. How can I do this? Should it be done in a spreadsheet or can access do it?
 
Hi

Try this example in the attachment

Basically the query uses two inbuilt functions mid and len

Mid requires 3 pieces of information

1) The data you want to view
2) The position you want to start at
3) The position you want to finish at.


You know you don't want the first 2 digits so you can enter 2 for the start position.

mid(101,2 ...

As you want everthing to the right of 10 but you may not know how long the data is you can use the len() function to return the length of the whole data, item in this case 3.


so mid(101,2,len(100))
is mid(101,2,3)

Hope that helps

Chris
 

Attachments

Is 10477899 a string or a number? If it's a string, the previous responses will fill the bill. However, if it's a number, a different approach is required. From the debug window:
Code:
x = 10477899
? mid(ltrim(str(x)), 3)
477899
 

Users who are viewing this thread

Back
Top Bottom