Access replace comma (,)  with dash (-)

Posted on 2012-08-16
Medium Priority
Last Modified: 2012-08-21
This is the access file that I have and I need to replace the commas in ("WorkCodes") column to dashes but I dont know how to do it.
Please help!
Question by:pauledwardian
  • 2
  • 2
LVL 75

Accepted Solution

DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 38302676
You can use the Replace() function in an Update query..... Example:

UPDATE Table1 SET Table1.FIELD1 = Replace([FIELD1],",","-");

Changes object names accordingly

Author Comment

ID: 38302710
ok this is the querry:
SELECT [SRO Num], DConcat("[Work Code]", "[Table2]", "[SRO Num] = '" & [SRO Num] & "'", ", ", "",
        False, "[Post Date], [Trans Num]" ) AS WorkCodes, Max([Post Date]) AS PostDate
FROM Table2

Open in new window

How can I have this querry to create a table after running and then it runs your code for the new created table:
UPDATE Table1 SET Table1.FIELD1 = Replace([FIELD1],",","-");

Open in new window

LVL 75
ID: 38302966
"How can I have this querry to create a table "

Change it to a MakeTable query ...

But, why not put that expression in the MakeTable query ... and do the conversion all at once ?


Author Closing Comment

ID: 38317515

Featured Post

Industry Leaders: 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

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

864 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