cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
507
Views
0
Helpful
1
Replies

Recreate a repot agent state detail - duration calc

dsobrinho
Level 9
Level 9

Hi team,

 

We have recreate a report via CUIC PREMIUM STANDALONE and now we need create a Formula Filed to calculate the duration of agent state. We have a column name transition time with the date and time  of event happens, and known that difference between hours in this columns will result in the duration time.

 

Does anybody know how calculate using SQL?

 

Daniel Sobrinho
1 Reply 1

piyush aghera
Spotlight
Spotlight

DATEDIFF(hour, start_date, end_date) will give you the number of hour boundaries crossed between start_date and end_date.


If you need the number of fractional hours, you can use DATEDIFF at a higher resolution and divide the result:

DATEDIFF(second, start_date, end_date) / 3600.0

 

The documentation for DATEDIFF is available on MSDN:

http://msdn.microsoft.com/en-us/library/ms189794%28SQL.105%29.aspx

 

refer this also: https://www.w3schools.com/sql/func_sqlserver_datediff.asp

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: