title: sql - Error converting data type nvarchar to numeric
body: <p>this query works fine</p>
  
  <pre><code>select *  from
  (select meas.Inspection_No, case 
  when ISNUMERIC(meas.InspectionValue) = 1 then
      cast(meas.InspectionValue as decimal(10,2))
      else 0 End as IVEKVol, meas.InspectionValue,  spec.Name, spec.   [Description], meas.LastDate, meas.ID  from
  (select ism.InspectionSpecificationMeasurementID, ism.Name, ism. [Description]  from PT_InspectionSpecification [is]
  inner join PT_InspectionSpecification_Measurement ism on   [is].InspectionSpecification_No = ism.InspectionSpecification_No
  where [is].PartDescription = 'Anode Dispense' and   [is].InspectionSpecification_type = 'Control Plan' and ism.Name LIKE 'I-IVEKVol    Recorded%') spec
  inner join 
  PT_InspectionItem_Measurement  meas on  spec.InspectionSpecificationMeasurementID =   meas.InspectionSpecificationMeasurementID) data
  </code></pre>
  
  <p>but when i add the where clause "where data.IVEKVol > 0" i get the error "Error converting data type nvarchar to numeric"</p>
  
  <pre><code>select *  from
  (select meas.Inspection_No, case 
  when ISNUMERIC(meas.InspectionValue) = 1 then
      cast(meas.InspectionValue as decimal(10,2))
      else 0 End as IVEKVol, meas.InspectionValue,  spec.Name, spec.   [Description], meas.LastDate, meas.ID  from
  (select ism.InspectionSpecificationMeasurementID, ism.Name, ism. [Description]  from PT_InspectionSpecification [is]
  inner join PT_InspectionSpecification_Measurement ism on   [is].InspectionSpecification_No = ism.InspectionSpecification_No
  where [is].PartDescription = 'Anode Dispense' and   [is].InspectionSpecification_type = 'Control Plan' and ism.Name LIKE 'I-IVEKVol    Recorded%') spec
  inner join 
  PT_InspectionItem_Measurement  meas on  spec.InspectionSpecificationMeasurementID =   meas.InspectionSpecificationMeasurementID) data
  where data.IVEKVol &gt; 0
  </code></pre>