Hola comunidad porque no me resulta esta funcion?
create FUNCTION [dbo].[cobranzaAnulados]
(
@codigoVendedor as int
)
RETURNS int
AS
BEGIN
--DECLARAMOS LAS VARIABLES QUE UTILIZAREMOS
DECLARE @retorno as int,@Cons as int,@Rev as int,@Nic as int
select @Cons = count(co1) from cccont1 a, ccasig1 b where
b.as1=a.co1 and b.as3=36 and (CO19='A')
union all
select @Rev = count(re1) from CCCREV1 a, ccasig1 b where
b.as1=a.re1 and b.as3=36 and (re13='A')
union all
select @Nic = count(cn1) from CCCNIC1 a, ccasig1 b where
b.as1=a.cn1 and b.as3=36 and (cn12='A')
@retorno = @Cons + @Rev + @Nic
RETURN @retorno
end
Desde ya muchas gracias!
.::**~ No Use for A NamE ~**::.