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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to replace character

Status
Not open for further replies.

Bammy217

Programmer
Sep 28, 2002
74
BE
Hey folks,

okay i need some help... I would like to replace some characters in the fields, so for example in stead of "123" i would like to replace the output to "1-2-3" please help...

thx
D,

We never fail, we just find that the path to succes is never quite what we thought...
 
You can use the Format function to resructure the data. You can use it in a query as long as all of the data is the same length and format.

SELECT QUERY
Select A.[FieldName], Format(A.[FieldName], "0-0-0") as Reformatted
FROM tblYourTable as A;

UPDATE QUERY
UPDATE tblYourTable as A SET A.[FieldName] = Format(A.[FieldName],"0-0-0");

Just update the table and field names to match yours and the Select will demonstrate to you how it works and the Update will change the data. Make sure that the field size is large enough to hold the extra characters(-).

Post back with any questions.

Bob Scriver
Want the best answers? See FAQ181-2886
Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top