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

How to truncate 1

Status
Not open for further replies.

goslincm

MIS
May 23, 2006
292
US
Hi, I am not sure how but there must be a way to do the following:

I have a field called [LocalUnit] and in it, information is entered like: "City of Clare" and I need to switch it around so it states: "Clare, City" only.

Is there some type of query that would allow me to make this type of switch?
 

UPDATE YourTableName
SET LocalUnit = Replace(LocalUnit, "City of ", "") & ", City";

But! It has to be "City of " on every record else it ain't gonna work
 
You may try this (SQL code):
UPDATE yourTable SET LocalUnit = Trim(Mid([LocalUnit],9)) & ', City'
WHERE LocalUnit Like 'City of *'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top