List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:July 20 1999 7:18pm
Subject:Re: printing users & Time
View as plain text  
Douglas Brantz wrote:
> 
> Thanks for all the help again on the time info.
> 
> I now need to do a fetch row on users last name, I guess first name as
> well  incase of brothers or sisters and then the total time that the
> person worked.  All this info would be in a table with first name last
> name and totaltime
> without repeating any names or times.  I would like to run this at
> anytime to get the total time of the users for paying purposes and for
> general info.  Eventually, I need to ask you how I would write it out to
> a log automatically every month which would be cool, but one step at a
> time for me.
> 
> So, for example I would like a table like this
> 
>      First name    |      Last name    |    Total Time worked so far
>    Douglas                  Brantz                04:30:30     -so even
> though I am in the table 10 times I get 1 reply
> 
> Hope that made sense, I tried to do the fetchrow but I keep getting
> multiple names and the wrong time.
> I think it could be done on one line or would I need multiple fetchrow
> statements.
> 
> Thanks
> 
> Douglas

Hi Douglas how about this one?
SELECT
	first_name
	,last_name
	,SEC_TO_TIME( SUM( TIME_TO_SEC( times ) ) ) AS total_time
FROM
	table
GROUP BY
	first_name
	, last_name

Tschau
Christian

PS: Sorry for the late answer, I was on vacation.

Thread
printing users & TimeDouglas Brantz14 Jul
  • Re: printing users & TimeChristian Mack20 Jul