My [calldetail_viw] doesn't have a tconnected column but it does have several columns that report in milliseconds. It also has a column called CallDurationSeconds. Here is the code to convert seconds and milliseconds to HH:MM:SS. Or you could also do this in excel if you just run the query and do the conversion in excel.
If you want to convert in Excel for MS = Cell with milliseconds (A2) / 1000 / 86400 and then right click format cell as Custom [H]:MM:SS
or if for seconds in Excel for Seconds = Cell with Seconds (A2) / 86400 and then right click format cell as Custom [H]:MM:SS
In SQL these both work; you will need to change the name of the column in bold below to your column name.
ISNULL(CAST(NULLIF(DATEDIFF(DAY, 0, DATEADD(MILLISECOND,
[tQueueWait], 0)), 0) AS varchar(3)) + ' days ', '') + CONVERT(varchar(8), DATEADD(MILLISECOND, [tQueueWait], 0), 8) AS QueueWait
CONVERT(time(0), DATEADD(SECOND,
[CallDurationSeconds], 0)) as CallDuration
------------------------------
Brad Goff
Palo Alto Networks, Inc.
------------------------------
Original Message:
Sent: 06-22-2021 04:11
From: Mohannad haddad
Subject: callDetail_viw
hey community
I was trying to build customization report on sql using callDetail_viw everything was going good until i saw the TConnected parameter , this parameter is calculated by millisecond I have tried to convert it to this formula (hh:mm:ss) but there is discrepancy between my result and the system result , does any one know how the system calculated it ????
thanks in advance for any help or tips
#ArchitectureandDesign
#AskMeAnything(AMA)
------------------------------
Mohannad haddad
Fourth Dimension Systems Company
------------------------------