On 11/9/02 3:01 AM, "Bruno Batarelo" <[EMAIL PROTECTED]> wrote: > Greetings > > I have problems executing very simple UPDATE query. I do not know whether it > is a bug or not, but it works in Access and also works with mySQL, but only > from access using linked tables. > Query is as followes: > > UPDATE Table_name SET Field_name = Left(Field_name, 4) & 'a' & > Right(Field_name, 4); > > This query should change every Field_name's 5'th character to 'a'. One more > thing - every record in this table has fixed size value so every value is a > string 10 characters long. When using access database or mysql database over > access everything goes well, but when using VB and MyODBC or just mysql > client, every Field_name's value bocomes 0 (zero). What did I do wrong? > > Thank you all > Bruno Batarelo
Maybe CONCAT() is the answer, haven't tried it though: UPDATE Table_name SET Field_name = CONCAT(LEFT(Field_name, 4), 'a', RIGHT(Field_name, 4)); <http://www.mysql.com/doc/en/String_functions.html> /h --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php