A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"replace" function in SQL



 
 
Thread Tools Display Modes
  #1  
Old July 28th, 2004, 11:00 PM
JasonS
external usenet poster
 
Posts: n/a
Default "replace" function in SQL

Good mornig / evening everybody!
I've got a question. Is there any way to modify a record within MS Access 2K
database using SQL?
Let's say that there is a field with such values (text):
wer234/4gd
2jklrumuu/ewq3
reew/kk62
344bn/ppppppppp
etc...

These values do not have same amount of characters..
What I want to do is to remove "/" (slashes) from these values. How can I do
it using SQL, or, if there is not such function in SQl, maybe it's possible
using VBA6?

Thank you 4 your help


  #2  
Old July 29th, 2004, 12:20 AM
Graham R Seach
external usenet poster
 
Posts: n/a
Default "replace" function in SQL

Jason,

The following query will replace all occurrences of slashes ( / ) in every
record in the table, with nothing:
UPDATE tblMyTable SET myField = Replace(myField, "/", "")
Rename all the objects to reflect the names you have given them, then run
the query.

The following query will replace all occurrences of slashes ( / ) in a
specific record, with nothing:
UPDATE tblMyTable SET myField = Replace(myField, "/", "") WHERE
someField = 123
Again, rename all the objects to reflect the names you have given them, and
change 123 to some meaningful value. Then run the query.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"JasonS" wrote in message
...
Good mornig / evening everybody!
I've got a question. Is there any way to modify a record within MS Access

2K
database using SQL?
Let's say that there is a field with such values (text):
wer234/4gd
2jklrumuu/ewq3
reew/kk62
344bn/ppppppppp
etc...

These values do not have same amount of characters..
What I want to do is to remove "/" (slashes) from these values. How can I

do
it using SQL, or, if there is not such function in SQl, maybe it's

possible
using VBA6?

Thank you 4 your help




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Function for % gain? Norman Harker Worksheet Functions 4 April 1st, 2004 11:54 AM
Dedupe Function works/works not Tom Bock Worksheet Functions 5 March 17th, 2004 08:41 PM
Modify "Remove Dots" function Tom Bock Worksheet Functions 3 March 15th, 2004 09:28 PM
WEEKNUM function david p Worksheet Functions 8 March 13th, 2004 03:24 PM
VBA user-defined worksheet function Val Worksheet Functions 2 December 8th, 2003 07:53 AM


All times are GMT +1. The time now is 11:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.