title: Can I limit the length of a specific column's characters inside a Query formula?
body: <p>I have the following <code>Query</code> formula nested inside a few <code>Sort</code> formulas that's working perfectly right now:</p>
  
  <pre><code>=ARRAYFORMULA((SORT((SORT((SORT((QUERY('Paste Data Here'!A3:V, "where Q = 1 and V = 1",0)),12,TRUE)),7,FALSE)),6,FALSE))
  </code></pre>
  
  <p>What I would like to do is trim the end of the data in <code>'Paste Data Here'</code> <code>Column H</code> as part of the <code>Array formula</code>. If done separately (without the <code>Query</code>), I can trim <code>Column H</code> the I want with this formula:</p>
  
  <pre><code>=LEFT(H3,(LEN(H3)-12))
  </code></pre>
  
  <p>Is there a way I can insert the second formula into the first? I'm at the point where I'm just guessing and throwing it in there all over the place and don't seem to be getting anywhere.</p>
  
  <p>Thank you!</p>
  
  <p><strong>EDIT:</strong> Thanks to @MattKing for getting me almost all the way there. My formula works after updating it to:</p>
  
  <pre><code>=ARRAYFORMULA((SORT((SORT((SORT((QUERY({'Paste Data Here'!A3:G,IFERROR(LEFT('Paste Data Here'!H3:H,LEN('Paste Data Here'!H3:H)-12)),'Paste Data Here'!I3:V})),12,TRUE)),7,FALSE)),6,FALSE)))
  </code></pre>
  
  <p>However, for some reason when I try to get rid of the <code>Sort</code> functions as he suggested with the following formula, I get a <code>Query completed with an empty output</code> message:</p>
  
  <pre><code>=ARRAYFORMULA(QUERY({'Paste Data Here'!A3:G,IFERROR(LEFT('Paste Data Here'!H3:H,LEN('Paste Data Here'!H3:H)-12)),'Paste Data Here'!I3:V}, "where Col12 = 1 and Col21 = 1 order by Col12 asc, Col7 desc, Col6 desc",0))
  </code></pre>
  
  <p>Could it have something to do with the columns referenced? I'm really new to <code>Query</code> formulas so I have no clue what I need to fix here...</p>