I have the following code in Access and I need it to work in sql, the Is numeric portion is throwing me off.
Sum([Employee Count]*IIf(IsNumeric([Length]),[Length
You can also just filter "not isnumeric" out since 0 will not impact SUM aggregation.
select
Sum([Employee Count]*[Length]) AS Total_hours
...
where isnumeric([Length]) = 1
See code below.
declare @table table (abc varchar(100))
insert into @table
select '1'
union select '200'
union select '200A'
select sum(convert(int,abc))
from @table
where isnumeric(abc) = 1
sqlfiddle