tomando en cuenta los datos que posteaste, quedaria algo asi :)
Código SQL:
Ver originalCREATE TABLE #llamadas_totales
(
inicio datetime,
fin datetime,
anexo INT,
numero VARCHAR(20)
)
INSERT INTO #llamadas_totales VALUES ('2014-01-31 11:26:17.663','2014-01-31 11:26:29.847',11097,'11092')
INSERT INTO #llamadas_totales VALUES ('2014-01-31 11:11:58.903','2014-01-31 11:14:50.553',11097, '11019')
INSERT INTO #llamadas_totales VALUES ('2014-01-31 10:59:01.823','2014-01-31 11:00:34.483',11097, '25998')
INSERT INTO #llamadas_totales VALUES ('2014-01-30 16:28:47.083','2014-01-30 16:28:49.407',11097, '9989140938')
INSERT INTO #llamadas_totales VALUES ('2014-01-30 16:19:11.613','2014-01-30 16:19:17.260',11097, '9989140938')
INSERT INTO #llamadas_totales VALUES ('2014-01-30 16:16:42.070','2014-01-30 16:16:45.563',11097 ,'11091')
INSERT INTO #llamadas_totales VALUES ('2014-01-30 14:52:54.073','2014-01-30 14:54:20.437',11097, '2083')
INSERT INTO #llamadas_totales VALUES ('2014-01-30 00:15:41.147','2014-01-30 00:18:14.427',11097, '989140938')
INSERT INTO #llamadas_totales VALUES ('2014-01-30 00:14:15.060','2014-01-30 00:14:29.230',11097, '9989140938')
INSERT INTO #llamadas_totales VALUES ('2014-01-30 00:12:36.030','2014-01-30 00:13:50.370',11097, '989140938')
INSERT INTO #llamadas_totales VALUES ('2014-01-30 00:11:34.233','2014-01-30 00:11:40.553',11097, '989140938')
INSERT INTO #llamadas_totales VALUES ('2014-01-30 00:02:20.510','2014-01-30 00:11:15.950',11097, '9989140938')
CREATE TABLE #conexion
(
agente INT,
anexo INT,
hora_conexion datetime,
hora_desconexion datetime
)
INSERT INTO #conexion VALUES (208,11097,'2014-01-29 23:55:08.015','2014-01-30 01:03:33.948')
INSERT INTO #conexion VALUES (208,11097,'2014-01-30 16:18:42.562','2014-01-30 16:28:00.527')
INSERT INTO #conexion VALUES (208,11097,'2014-02-01 16:43:51.727','2014-02-01 16:44:28.262')
INSERT INTO #conexion VALUES (208,11097,'2014-01-30 16:34:11.104','2014-01-30 16:53:21.482')
INSERT INTO #conexion VALUES (208,11097,'2014-01-30 17:07:39.587','2014-01-30 17:36:29.158')
SELECT isnull(t3.calculado,'llamada se realizo no conectado al sistema') AS calculado,isnull(t3.inicio,t4.inicio) AS inicio, isnull(t3.fin,t4.fin) AS fin,isnull(t3.anexo,t4.anexo) AS anexo, isnull(t3.numero,t4.numero) AS numero,t3.agente FROM(
SELECT * FROM(
SELECT
CASE
WHEN inicio BETWEEN hora_conexion AND hora_desconexion THEN 'llamada se realizo conectado al sistema' ELSE 'llamada se realizo no conectado al sistema' END AS calculado,inicio,fin,t1.anexo,t1.numero,t2.agente
FROM #llamadas_totales AS t1
LEFT JOIN #conexion AS t2 ON (t1.anexo=t2.anexo)
) completa WHERE calculado='llamada se realizo conectado al sistema'
) AS t3
RIGHT JOIN #llamadas_totales AS t4 ON (t3.inicio=t4.inicio)
saludos!