|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Transact-SQL - How do I Calculate Average Leadtime in sqlserver...
Hi,
How do I Calculate Average Leadtime... I have a Table named "iCalls_Calls" which has 2 Columns (start_Date and Closed_Date).I need to calculate average leadtime based on the columns from this table . I have a query and i need to add this ( calculate average leadtime) to this query. Code:
SELECT B.USER_DIVISION,B.USER_DEPARTMENT,COUNT(*) FROM iCalls_Calls A INNER JOIN iCalls_Users B on A.REQUESTOR = B.USER_ID GROUP BY USER_DIVISION,USER_DEPARTMENT Can anyone send me the correct query to calculate the average time ? Thanks.. |
|
#2
|
||||
|
||||
|
I am not sure where you'd put this. I guess as another column, but you could try:
This will give you the number of days between the start and close date. Then if you wanted to average them accross the entire table you could use the AVG function in sql.
__________________
Slarentice (origin:Shadow Wizard of ASP Free) [noun] A slave and apprentice of the Wizard's Circle (specifically of mehere) at ASP Free. ---- If shemzilla takes over, it's best to be on his good side ![]()
|
|
#3
|
|||
|
|||
|
Re:Please help me with the Syntax for this Sql Query.
Hi..Thanks for the query..
But i need to calculate average time in " Hours and Minutes" and not in days... So can you please help me with the syntax for returning Hours and minutes. Thanks. Quote:
|
|
#4
|
|||
|
|||
|
__________________
jmurrayhead Did I help you out? Make me popular by clicking the icon!New Members:Proper way to post a question .Net Help |
|
#5
|
|||
|
|||
|
Re:Please help me with the Syntax for this Sql Query.
|
|
#6
|
||||
|
||||
|
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Transact-SQL - How do I Calculate Average Leadtime in sqlserver... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|