Access replace comma (,)  with dash (-)

Posted on 2012-08-16
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
    LVL 75

    Accepted Solution

    You can use the Replace() function in an Update query..... Example:

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

    Changes object names accordingly

    Author Comment

    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
    GROUP BY [SRO Num];

    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

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    "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


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    754 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

    19 Experts available now in Live!

    Get 1:1 Help Now