Results 1 to 4 of 4

Thread: time spent

  1. #1
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    132

    Unanswered: time spent

    i have book,employee, time_start and time_end columns.
    i have to get the total time spent in every book.
    how can i get the total time spent?

    e.g.
    time_start - time_end
    10:00 - 10:30
    10:31 - 11:00
    11:00 - 11:30
    11:30 - 12:00

    how can i get 10:00(time_start,first row) - 12:00 (time_end, last row)?

    pls advice

    thanks
    Take Nothing But Pictures;
    Leave Nothing But Footprints;
    Kill Nothing But Time;

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sorry, we will not do your homework for you

    please give it a try, test it, and if you have any problems, show your query and your test results and we might offer our comments
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    132
    here is what ive searched.

    TIMEDIFF(MAX(key_entry_log.Time_End),MIN(key_entry _log.Time_Start)) AS 'Time_Consumed'

    is this right? i have already tried it and it works...is there other way?

    thanks
    Take Nothing But Pictures;
    Leave Nothing But Footprints;
    Kill Nothing But Time;

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    excellent! nice job

    see, you didn't need us after all

    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
  •