title: SQL convert nvarchar to float
body: <p>I have a table with a column <code>Quantity</code>; in the original table this column is defined as <code>nvarchar(100)</code> so I need to cast it as float to be able to do some analysis:</p>
  
  <pre><code>CAST([Quantity] AS FLOAT) AS Quantity      
  </code></pre>
  
  <p>The issue is that I have some values which can not be converted to float like <code>No-Quantity</code>, <code>Return</code> etc. I to have filter to exclude these values and then convert rest to float.On option is use where clause:</p>
  
  <pre><code>WHERE Quantity IN ('Return', 'Sales')
  </code></pre>
  
  <p>This is not the best way since if we have anew values in the original table then I need to figure out what it is and add it to the where clause. </p>
  
  <p>I am wondering is there is better way to identify non-convertible values?</p>