I have a query that returns a list of 2 dates, like so:
Date1 Date2
11/01/1999 04/14/2004
01/01/2003 09/23/2004
.......... ...........
What I need to do is get an average time elapsed between the two dates for the entire recordset.
So far, I loop through each row and get the difference (in days) between the two dates using the datediff() function. I add the difference to a running total to get a total number of days and then divide by the number of records to get an average number of days.
My problem is that I need to turn the average number of days into Years, Months, Days.
Any Suggestions?
Date1 Date2
11/01/1999 04/14/2004
01/01/2003 09/23/2004
.......... ...........
What I need to do is get an average time elapsed between the two dates for the entire recordset.
So far, I loop through each row and get the difference (in days) between the two dates using the datediff() function. I add the difference to a running total to get a total number of days and then divide by the number of records to get an average number of days.
My problem is that I need to turn the average number of days into Years, Months, Days.
Any Suggestions?