I am trying to return a sum only if it's > 0 else, I want to return 0.
This is what I have now.
Select sum(quan*costeach) from dba.posdetail where prodnum in (select prodnum
from dba.product where reportno = 993301) and transact = 100
If the sum is > 0 then return the sum, else return 0.