[AccessD] Edit contents of field.

Sheri Hixson sdhi at kalamazoo.net
Sun Aug 8 21:18:36 CDT 2004


"Create a function" ? Could you explain the steps involved for that? Thanks.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Sunday, August 08, 2004 10:05 PM
To: Access Developers discussion and problemsolving
Subject: Re: [AccessD] Edit contents of field.


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


-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com






More information about the AccessD mailing list