08-14-2008 09:59 AM - last edited on 03-25-2019 07:43 PM by ciscomoderator
I am looking for the SQL statement that can be used in a query (Query Analyzer) against the CDR database to convert the format from Epoch to MM/DD/YY 00:00:00.
I've googled "Unity Epoch time" (as mentioned on one forum posting) and even asked TAC, but no luck.
Any assistance would be greatly appreciated.
Solved! Go to Solution.
08-15-2008 04:18 AM
Hi
The statement you are looking for is:
DATEADD(s, dateTimeOrigination, '19700101')
i.e. select DATEADD(s, dateTimeOrigination, '19700101'), duration, callingPartyNumber, originalCalledPartyNumber from callDetailRecord
As a bonus, you can also use
CONVERT(varchar(6),duration/3600)+':'+RIGHT('0'+CONVERT(varchar(2),(duration % 3600)/60),2)+':'+RIGHT('0'+CONVERT(varchar(2),duration%60),2)
to convert the duration from seconds to H:M:S
08-15-2008 04:18 AM
Hi
The statement you are looking for is:
DATEADD(s, dateTimeOrigination, '19700101')
i.e. select DATEADD(s, dateTimeOrigination, '19700101'), duration, callingPartyNumber, originalCalledPartyNumber from callDetailRecord
As a bonus, you can also use
CONVERT(varchar(6),duration/3600)+':'+RIGHT('0'+CONVERT(varchar(2),(duration % 3600)/60),2)+':'+RIGHT('0'+CONVERT(varchar(2),duration%60),2)
to convert the duration from seconds to H:M:S
08-15-2008 04:52 AM
Thank you, I'll try this today.
08-29-2008 10:49 AM
Thank you, this resolved my issue.
I used the DATEADD line and was able to print a readable report.
Debbie
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide