Results 1 to 4 of 4

Thread: SUM epoch time

  1. #1
    Join Date
    Oct 2012
    Posts
    2

    Unanswered: SUM epoch time

    I have a query that converts epoch time to normal time and formatted it to only return the time and not the date as well. That part works fine. Now I'm trying to SUM that field but the normal time sum doesn't work. How do I sum a field that has been converted to a different datatype?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    please explain how summing epoch times produces anything meaningful or logical

    what is today plus yesterday? what is 2012-09-09 + 2011-10-13?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Oct 2012
    Posts
    2
    It is very logical if you are adding or averaging call times for ONE day. i.e. talk time, wait time, etc. I can't just divide by the amount of records because the records change daily for each employee. let's say the employee has 12 calls each lasting different times. I want to average and sum the amount of time this employee was talking on the phone. I'd say summing epoch would produce something meaningful in this situation. As stated on my original post I formatted the converted epoch time to remove the date and only show time so I don't know where today plus yesterday came from.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    okay, i think i see where you're trying to go

    what you want is to sum call times

    call times would be defined as datetime_call_stopped - datetime_call_started

    just summing up times won't work
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •