This is obviously just a piece of the code but, when it hits this area I receive this error "data type mismatch". The column a.split_in is a character, but I need to use this in order to run my calculation.
select iif(a.split_in="Y",a.price*a.catchweight,"")as T