title: CASE statement for checking a field value
body: <p>Hopefully you guy's can help.</p>
  
  <p>I am writing a query from a table which has variable data specifically a <code>completed</code> column which can have a value of <code>1</code> or <code>3</code> the table also has two qty_ fields <code>QTYORDERED</code> and <code>QTYSHIPPED</code>  </p>
  
  <p>If the value is <code>3</code> in <code>COMPLETED</code> then <code>QTYSHIPPED</code> will contain a value and if the value is <code>1</code> the <code>QTYORDERED</code> will have a value. </p>
  
  <p>What I need to do is within my query create one column which just has a <code>QTY</code> can someone show me how to achieve this in SQL Server</p>