MySQL Replace portion of a string that appears after another string -


I have a varchar field in which notes are included. I see each instance of an object on a different line below. Trying to type a query that replaces the date time version that appears next to the "next contact" string with a new date.

As you can see, there are other dates in the notes, so ReqExp will not work for me to search for a single date

Here's what I try :

  How do I see it? Set the funnel_deals to `Note` = Replace (substroke (note, locate ('Next contact:',` note`), 35), 'Next contact: 2014-12-12 11:15:00' Jfoster 'Set up update funnel_names` = replace (right (`note`, locate (' next contact: ',` note`), 35),' next contact: 2014-13-12 12:15:00 ' = 'Jfoster' both return a syntax error: The first query: [Error] 1064 - There is an error in your SQL syntax; Manual which is its syntax Passes near corresponds to your MySQL server version for use), where username = 'jfoster' 'line View second on 1: [error] in 1064 - is an error in your SQL syntax; For the manual which is related to the correct syntax for using '35' pass for your syntax, check 'Next Contact: 2014-13-12 12:15:00'), where username = 'jfoster' ' Note column on line 1 includes:  
  Note: AAA Deal's Name: Second V27 Quotation Contact Type: Demo-Set-Pre Contact Disposal: Funnel status: Presentation (demo or pitch) Last contact: 2014-10-08 10:25:30 Next contact: 2014-10-12 10:15:00 Quotation amount: 1200s Draft possibilities: 0   

How do I return the syntax errors, even after changing the query. Is this the right way to reach it?

If date / time format is fixed, then you can try something like this

  Update for Funnel SET Note = CONCAT (SUBSTRING_INDEX (note, 'Next contact:', 1), 'Next contact: 2014-12 - 12 11:15:00, 'SUBSTRING (SUBSTRING_INDEX (note,' next contact: ', -1), 20)) username =' foster ';   

Here is the demo

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -