Solved

How remove hyphens from field data in a table

Posted on 2014-11-19
2
220 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
2 Comments
 
LVL 33

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now