I'm trying to reuse the result of a procedure so I do not call it twice again, because it takes too long to do so.
select DW.dbo.procedimiento(CONVERT(char(10), FecLlamada, 103),
CONVERT(char(5), HorLlamada, 108),
CONVERT(char(10), FecContestada, 103),
CONVERT(char(5), HorContestada, 108)) AS TiempoRespuestaMinutos
(CASE WHEN Segmentacion >= 1
AND Segmentacion <= 1.5
AND 'TiempoRespuestaMinutos' > 150
THEN 0
ELSE 1 END) AS CumplimientoTRG
from llamadas
Where it says 'MinutesResponseTime' is where I want to put what the procedure returns.
Thank you!