[thelist] SQL Question - Drop the last charector of a string

Rob Smith rob.smith at lexjet.com
Mon Aug 7 10:30:04 CDT 2006


Ok, Try this before attempting to move everything back...

UPDATE temp_headings set sub_heading = replace(sub_heading,
right(sub_heading,1),'') WHERE right(sub_heading,1) = '-'
...which basically translates into, "Replace all hyphens at the end of
the sub_heading field with nothing". Can someone please check my syntax,
I have a sneaky suspicion that it'll replace the entire sub_heading
field with '' wherever there is a hyphen at the end... If you feel gutsy
Casey seeing that this is a temp table anyway, go ahead and play with
this concept until you get it right if you don't want to wait or hear
from someone else.

Then it's a simple INSERT INTO FROM 

Rob Smith
LexJet
rob.smith at lexjet.com
http://www.lexjet.com
(800)453-9538
(941)330-1210 Int'l
(941)330-1220 Fax
1680 Fruitville Road, 3rd Floor
Sarasota, FL 34236




More information about the thelist mailing list