Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Delete first 2 digits off a number

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jont - 24 May 2007 15:14 GMT
Hi can anyone help. I have a field in a table in my database which is
used  for fax numbers our old system used to have all fax numbers
prefixed with 9,  ie 9,01234 546785   our new system no longer needs
the 9, (new format 01234 546785) and I need to remove it.  many of the
numbers in the field already have the 9, missing and are also of
varying lengths. Can anyone tell me how to do this. Thanks
Dale Fye - 24 May 2007 15:29 GMT
If all of your FAX numbers that have the "9," prefix actually have both of
these characters, then you could write an update query.

Update yourTable
Set [Fax_Num] = MID([Fax_Num], 2)
WHERE LEFT([Fax_Num], 2) = "9,"

*Note: Always backup your table/database before you try something that could
drastically change your data.

HTH

Signature

Email address is not valid.
Please reply to newsgroup only.

> Hi can anyone help. I have a field in a table in my database which is
> used  for fax numbers our old system used to have all fax numbers
> prefixed with 9,  ie 9,01234 546785   our new system no longer needs
> the 9, (new format 01234 546785) and I need to remove it.  many of the
> numbers in the field already have the 9, missing and are also of
> varying lengths. Can anyone tell me how to do this. Thanks
Ofer Cohen - 24 May 2007 15:30 GMT
Try something like

Right([FieldName],Len([FieldName])-Instr([FieldName],","))

You don't have to delete the digits, you can use select query with the above
to display a new field.

If you still want to update the records *****BACKUP YOUR DATA *****
and then run update query with the above

Signature

Good Luck
BS"D

> Hi can anyone help. I have a field in a table in my database which is
> used  for fax numbers our old system used to have all fax numbers
> prefixed with 9,  ie 9,01234 546785   our new system no longer needs
> the 9, (new format 01234 546785) and I need to remove it.  many of the
> numbers in the field already have the 9, missing and are also of
> varying lengths. Can anyone tell me how to do this. Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.