Código:
CREATE PROCEDURE sp_ObtenerIntereses @Trimestre int, @Anio int AS select [COLOR="Red"]DateDiff(d,Intereses.FechaVencimiento, Intereses.FechaRecaudacion) as DiasMora [/COLOR] from PagosIntereses as Intereses left join ExcelTemporalIntereses as excel on intereses.CiaID=excel.CiaID inner join [svr-dc-ui].Entidades.dbo.Companias as entidad on Intereses.CiaID= entidad.CiaID Where Intereses.Trimestre = @Trimestre and Intereses.Anio = @Anio GO
La store se llama spu_RetornaCantDiasHabilesEntreFechas
Este código me pasó el tipo:
Código:
@DIAS AS INT spu_RetornaCantDiasHabilesEntreFechas @FDESDE,@FHASTA,@CantidadDias=@DIAS OUTPUT
Este select trae algo así como esto:

Al que me ayuda le chupo la pija.


Comentario