Hi,
Puzzled by this error message:
"Invalid argument types for function 'IFF': (Float, VARCHAR(7), VARCHAR(13))
Mostly because I am using Case When statement, not IFF
Any ideas?
Thanks
cte_revenue_product_group
(Order_Nbr
, Revenue_Product_Group)
as
(
select
o.order_nbr
,case
when (left(rp.revenue_product, 6) = 'Alpha' and ie.Check ) then 'Zeta'
when left(rp.revenue_product, 6) = 'Alpha' then 'Upsilon'
when left(rp.revenue_product, 7) - 'Kappa' then 'Kappa'
when contains(o.revenue_code_2, 'Mu') then 'Omicron'
when contains(o.revenue_code_2, 'Pi') then 'Rho'
else 'Omega'
end
"Revenue Product Group"
from
cte_order o
inner join
cte_revenue_product rp
on
o.order_nbr = rp.order_nbr
inner join
cte_is_enterprise ie
on
o.order_nbr = ie.order_nbr
)
select *
from cte_revenue_product_group