Cannot CAST '33.33' to INT I have encountered a problem where the WHERE clause is causing a problem.  The varcharColumn is of datatype VARCHAR and contains numbers as well as text.  The query looks to be averaging this column, but it has now hit a problem when a number has a decimal, e.g. 33.33.

SELECT AVG(CONVERT(INT,[varcharColumn])) 
  FROM View 
 WHERE [varcharColumn] &gt; 0 
   AND [varcharColumn] &lt;&gt; 'NA' 
   AND CreatedDate &gt; @StartDate AND CreatedDate &lt;@EndDate


Now, I have tried to CAST and CONVERT the varcharColumn in the WHERE clause, but this returns no results.  Any ideas?
Try this 

    SELECT AVG(cast(cast([varcharColumn] as decimal) as int))
      FROM View 
     WHERE isnumeric([varcharColumn]) = 1 
     AND cast(cast([varcharColumn] as decimal) as int) &gt; 0
     AND CreatedDate &gt; @StartDate AND CreatedDate &lt; @EndDate