List:General Discussion« Previous MessageNext Message »
From:Jim Faucette Date:July 15 1999 4:42pm
Subject:Re: Sum of seconds?
View as plain text  
I'm not a perl-er, but your script needs to connect, then query, then

And the group by should to be:
  GROUP BY lastn, firstn
otherwise all people with lastn 'Brown' will show up as one entry.


Douglas Brantz wrote:
> Thanks, it works fine.
> But now I am having trouble putting this into a perl file for it to
> work.
> What would the syntax be for putting that into a fetchrow or do I need
> it in a fetchrow?
> Here is what I am trying.  I am very new at this.
> my $i="";
> $i=1;
> while (@record = $sth$i->FetchRow)  {
> my $sth$i = $dbh->Query("select
> SEC_TO_TIME(sum(outtime-intime)),firstn,lastn from
> monitor where lastn=\"$lastn\" and firstn=\"$firstn\" group by lastn ")
> or die $Mysql::db_errstr;
> $total,$firstname,$lastname = $record[0]; $bar = $record[1];
> $i++
> }
> print "$total, $firstname, $lastname</td><td align=center>";
Sum of seconds?Douglas Brantz15 Jul
  • Re: Sum of seconds?Sasha Pachev15 Jul
  • Re: Sum of seconds?Douglas Brantz15 Jul
    • Re: Sum of seconds?Paul DuBois15 Jul
  • Re: Sum of seconds?Jim Faucette15 Jul