title: Unable to filter the data because of spaces in data in SQL Server 2008
body: <pre><code>select DISTINCT rtrim(ITEMID)   
  FROM [MIS-028].[AX-DW-QTY].[dbo].ITEMQTYHISTORY_2   
  where ITEMID = 'S991071215'
  </code></pre>
  
  <p>This record is present in table but when im going to filter with this id not getting any record because in this id there is some space than i am use ltrim,rtrim after that also im not getting any record so plz tell what i have to do </p>