I have a problem getting a correct result with my sql code and figured I would see if anybody could help.
I have two fields in a table that have timestamps. I want to find the difference in time between the two stamps and then calculate the average. Here is the code that I have come up with so far.
Expand|Select|Wrap|Line Numbers
- SELECT AVG(TIMEDIFF(departure_Time, arrival_Time)) as average
- FROM t1
- WHERE
- employee_Number= '3'
Expand|Select|Wrap|Line Numbers
- departure_Time arrival_Time
- 2007-09-23 13:15:29 2007-09-23 13:42:45
- 2007-09-23 17:26:41 2007-09-23 17:27:41
Also, if someone has a better way of doing this, I am open to suggestions.
Thanks guys!
Frank