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!

replace information using INSERT

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
US
I have a table with a column of data.
The data will show for example:
ETS-BT
ETS-FG
ETS-CC
I want to change this to:
AG-BT
AG-FG
AG-CC

I need to make an insert statement that when it sees ETS it changes that to AG but leaves the suffix data after ETS as is.

 
Do you want to replace those records or merely insert new ones, leaving the old ones in place? I assume you want to update the old ones. Try this:

Code:
UPDATE tblTable SET [FieldName]=Replace([FieldName],"ETS-","AG-");


-V
 
How should it be written if it is run in Access only?
 
i tired that but was unsuccessfull with updating/replacing for example:
ETS-Form with AG-Form.
Everything to the right of the dash must stay the same.
 
What is YOUR actual SQL code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Everything to the right of the dash must stay the same.
The statement provided by VRoscioli will do exactly that. You have to put in the name of your table and your field name.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top