Solved

How remove hyphens from field data in a table

Posted on 2014-11-19
2
235 Views
Last Modified: 2014-11-19
I have a table that has a text field.  The data in this field for all records has hyphens.  For example:

01-0209-090-1030

I want to remove the hypens using a query so that the end result, for example, is 0102090901030.

How can I do this?
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Accepted Solution

by:
Mike Eghtebas earned 250 total points
ID: 40453062
Dim strTemp As String

strTemp ="01-0209-090-1030"    

strTemp = Replace (strTemp , "-", " ")  '<-- this will give 01 0209 090 1030

strTemp = Replace (strTemp , "-", "")  '<-- this will give 0102090901030

strTemp = Replace (strTemp , "-", "*")  '<-- this will give 01*0209*090*1030
0
 
LVL 22

Assisted Solution

by:Kelvin Sparks
Kelvin Sparks earned 250 total points
ID: 40453097
To build on @eghtebas response to do in a query

UPDATE yourtable SET fieldname = REPLACE(fieldname,"-","") will give you the outcome that you're looking for.

Edit my code to put your table name into the yourtable part, and the column name into the fieldname part (2 places).


Kelvin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question