Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A query to delete a portion of a field?

Status
Not open for further replies.

JJman

Technical User
May 8, 2003
89
IN

How would I go about changing all the values in a field with alpha-numerics to remove the dashes (i.e. to change entries like BR-312-8212 to BR3128212)? Thanks!



 
Hi,

If they are all in the same format, I would use an Update SQL statement with the Mid$ function to extract the appropriate sections of the data.

John
 
You can look at the Replace Function. In a module you would put
Fuction myfunction(myval as String) as String
myfunction = Replace(myval,"-","")
End Function

Then in a query you could put

MyField:myfunction([FieldName])

This would give you
BR3128212

as the return value for your example.

Paul

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top