title: Convert integer to hex and hex to integer
body: <p>So I have this query working (where <code>signal_data</code> is a column) in Sybase but it doesn't work in Microsoft SQL Server:</p>
  
  <pre><code>HEXTOINT(SUBSTRING((INTTOHEX(signal_data)),5,2)) as Signal
  </code></pre>
  
  <p>I also have it in Excel (where <code>A1</code> contains the value):</p>
  
  <pre><code>=HEX2DEC(LEFT(DEC2HEX(A1),LEN(DEC2HEX(A1))-2))
  </code></pre>
  
  <p>Does anyone know how I would do this in SQL Server?</p>