Using MySQL to TRIM and SUBSTRING_ INDEX to remove all characters to the right
<p>I have a MySql table called widgets_items_model and in that table there is a column called notes.  I want to 
remove everything to the right of YYYY from only the records that have the following string in them:</p>

<p>This clients tracking number --  YYYYNNAA:  2015BA99 Project578</p>

<p>I have this SQL code that so far: </p>

<pre><code>UPDATE widgets_items_model SET notes = TRIM(TRAILING SUBSTRING_INDEX(notes, 'YYYY', -1) FROM notes);
</code></pre>

<p>When I run the SQL it removes everything to the right of YYYY but it also empties every  'notes' field except for
the ones I wanted to trim.   For the fields I wanted to TRIM it does exactly what I wanted but all other notes fields data is being deleted instead of being left undisturbed.</p>

<p>How can I format the SQL so it trims everything to the right of YYY and does not empty the other fields 'notes' data? </p>