[AccessD] Edit contents of field.

Stuart McLachlan stuart at lexacorp.com.pg
Sun Aug 8 21:04:52 CDT 2004


On 8 Aug 2004 at 21:53, Sheri Hixson wrote:

> I'm just not getting this. I have a 30,000 record table that I've imported.
> The first field has a product number with 4 hyphens - like 12-34-567-8888. I
> need to take the hyphens out of these product numbers. Hopefully with a
> query. I have Access XP and need this to be simple and hopefully as easy as
> possible. Any help would be appreciated.
> 

Since AccessSQL doesn't know about the built in Replace() function, try 
this:

Create a function.
Function MyReplace(OriginalText As String) As String
	MyReplace = Replace(OriginalText, "-", "")
End Function

Then run a query:
"UPDATE myTable  SET myField = MyReplace([myField]);"

-- 
Stuart





More information about the AccessD mailing list