• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need a little database help

DnetMHZ

Diamond Member
ok heres what I need to do.. I have an access 97 database which is part of some phone accounting software we run.
there is a table which has about 1000 phone numbers in it in the format 1xxxxxxxxxx what i need to do is trim off the 1's before the area code from every number. Exporting the data to another app. is not an option. Is there an easy way to change all these numbers?

Thanks
DnetMHZ
 
Dunno if Access supports real SQL queries but you can do it with the following SQL query...

UPDATE table_name SET column_name = LTRIM(column_name, '1');

 
Not sure if what Mitzi said will work in Access, as every ltrim() function I've seen simply left-trimmed the spaces. That's the way it is in SQL Server anyway...

You could do this, however...

update yourtable set yourphonenumberfield = mid(yourphonenumberfield, 2, len(yourphonenumberfield))
 


<< Not sure if what Mitzi said will work in Access, as every ltrim() function I've seen simply left-trimmed the spaces. That's the way it is in SQL Server anyway... >>



LTRIM trims spaces if you don't provide a different set of extraction characters. Thats the SQL99 standard and how Oracle does not - not used SQL Server though.
 
Back
Top