If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Delete Specific Characters From Text
I am trying to create an Update Query that will strip out certain characters from a string in a text field (specifically hyphens and slashes) while leaving the rest of the data in the record alone. The characters do not exist in all records and they are located in different positions in the field.
Examples: 1234-01, 12345-01, ABC/D, WX-YZ. Desired Result: 123401, 1234501, ABCD, WXYZ. Thanks for any help. jeff |
#2
|
|||
|
|||
Delete Specific Characters From Text
Jeff Monroe wrote:
I am trying to create an Update Query that will strip out certain characters from a string in a text field (specifically hyphens and slashes) while leaving the rest of the data in the record alone. The characters do not exist in all records and they are located in different positions in the field. Examples: 1234-01, 12345-01, ABC/D, WX-YZ. Desired Result: 123401, 1234501, ABCD, WXYZ. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Try this: UPDATE table_name SET column_name = Replace(Replace(column_name, "-",""),"/","") WHERE column_name LIKE "*[/-]*" Substitute your table name and column name where appropriate. See the VBA Help article on the Replace Function for more info. -- MGFoster:::mgf00 at earthlink decimal-point net Oakland, CA (USA) ** Respond only to this newsgroup. I DO NOT respond to emails ** -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQA/AwUBSZJAhoechKqOuFEgEQIuwACePAZLkVWrqkt6HRyxXxkGZR mcZH0Aniqx l8z6JcnMeWDRJLavj3dO6LyI =izvD -----END PGP SIGNATURE----- |
#3
|
|||
|
|||
MG:
Thank you very much for the tip. It worked exaclty as I needed. You saved me hours of manually deleting the characters I don't want. Jeff
__________________
jm |
Thread Tools | |
Display Modes | |
|
|