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] > 0 AND [varcharColumn] <> 'NA' AND CreatedDate > @StartDate AND CreatedDate <@EndDate
Now, I have tried to
varcharColumn in the
WHERE clause, but this returns no results. Any ideas?