1
I have the following appointment:
SELECT
ISNULL(MAX(CONVERT(TIME(0), DATEADD(SECOND, DATEDIFF(SS, [INICOLIGACAO],[FINALLIGACAO]), 0))),'') AS [DURACAO_CHAMADA]
WHERE
CONVERT(DATE,[DIA]) = '2019-10-30'
AND [CAMPANHA] = ('1')
GO
When I run it returns the error:
The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart. Warning: Null value is eliminated by an aggregate or other SET operation.
however when I change from seconds to minutes or even hours it returns the data, however accurate the data in seconds.
When DATEDIFF_BIG() is placed it gives the error:
'Datediff_big' is not a recognized built-in Function name.
I’m taking the calls just from the day before
the select I make is
SELECT
ACIONAMENTO
,CPF
,DDD+TELEFONE
,CONTRATO
,ISNULL(MAX(CONVERT(TIME(0), DATEADD(SECOND, DATEDIFF(SECOND,[INICOLIGAÇÃO],[FINALLIGACAO]), 0))) ,'') AS [DURACAO_CHAMADA]
,OPERADOR
FROM
TABELA
WHERE
CONVERT(DATE,[inicioligacao]) = CONVERT(DATE,GETDATE()-1)
AND [campanha] IN ('1')
If there was a crash then it’s because the data is wrong, because who would spend years on a call?
– José Diz
You have not yet provided your table data.
– Sorack
You showed the
query
which is performing but has not yet shown what data from its table– Sorack
@Sorack could be clearer.
– Paulo Henrique
@Paulohenrique clearer than to say that Voce needs to show the data set? I’m asking what’s inside your table, that you show lines, tuples.
– Sorack