Server: Msg 208, Level 16, State 1, Line 1 object name 'dbo.fn_dias' is invalid.to call the udf I'm using:
select dbo.fn_dias('2','210001')and here's the code:
CREATE FUNCTION dbo.Fn_Dias (@pCuenta varchar(5),@pTipoMovi varchar(6)) RETURNS table AS return SELECT DATEDIFF(Day, (SELECT Fecha FROM Transac01 WHERE Documento = Transac02.documento1 AND Tipomovi = Transac02.Tipomovi1), fecha) as dias FROM TRANSAC02 WHERE (cuenta = @pCuenta) AND (tipomovi = @pTipoMovi)At this time I just don't know what I'm doing wrong, so I'd appreciate any help!