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

Update Query

Status
Not open for further replies.

gfranklin

Programmer
Joined
Aug 12, 2002
Messages
7
Location
US
I need to run an update query to remove the dash - from the end of my column data but I'm unsure of the syntax

example of the data: 980890121-
239451-
4865000-
The lengths of the data in that column are not the same size which makes it difficult for me being a beginner to
SQL. Any ideas of how to do this would be greatly appreciated.

Thanks, Gabby
 
Try this...
update mytable
set myfield = left(myfield, len(myfield) -1)

This assumes that the dash is always in the last position.
Make a backup first, just in case :)
 
Use Replace Function:

UpdateMyTable
Set MyField = REPLACE(MyField,'-','')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top