in reply to Re: Re: Re: Funky date question.
in thread Funky date question.
the problem is some of my numbers come out obesly huge (and very wrong) and I cant quite figure out why.my $dbh = DBI->connect("dbi:Sybase:server=CASTOR",$USER, $PASS); my $select = "select entrydate,status from database order by entry +date"; my $START = undef; my $STOP = undef; my $CUSTHOLD = 0; my $LASTSTATE=''; my $sth=$dbh->prepare($select); $sth->execute; while ( my $row = $sth->fetchrow_arrayref) { my ($entrydate,$statusid) = @$row; $LASTSTATE=$statusid; if ($statusid != "hold") { if($START) { $STOP = parse_date($entrydate); $CUSTHOLD += $STOP - $START; $START=undef; } } else { if (!$START) { $START = parse_date($entrydate); } } if(($LASTSTATE eq "hold") && defined $START) { $CUSTHOLD += time - $START; } } return($CUSTHOLD);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Funky date question.
by da (Friar) on Jun 09, 2001 at 16:01 UTC | |
|
Re: Re: Re: Re: Re: Funky date question.
by mpolo (Chaplain) on Jun 09, 2001 at 12:24 UTC | |
by Mark 1 (Initiate) on Jun 09, 2001 at 12:30 UTC |