title: SQL Insert into query where part of the Select is a substring
body: <p>Morning All,</p>
  
  <p>I'm trying to create an Insert Into Select query where part of the criteria is obtained from truncating the values in a column eg</p>
  
  <pre><code>INSERT INTO tbRoom ([Ref],[Type])
  
  SELECT ([Ref],substring([Description], 1, charIndex(':',[Description] )-1)) FROM tbRoomUsage
  
  WHERE tbRoomUsage.Ref = 1
  </code></pre>
  
  <p>How do I structure the query to do the substring query as part of the overall Insert Into query?</p>
  
  <p>The </p>
  
  <pre><code>SELECT substring([Description], 1, charIndex(':',[Description] )-1) FROM tbRoomUsage 
  </code></pre>
  
  <p>works fine on its own in terms of selecting the truncated information I need.</p>
  
  <p>Thanks</p>
  
  <p>MG</p>