$sth=$dbh->prepare("select b.req_id,ccode from rtsdet a,rtshead b where b.req_id =a.req_id and date_stamp BETWEEN '2002/01/01' AND '2002/02/28'"); $sth->execute (); # will dump out all fields $data=$sth->dump_results(); #$data=$sth->dump_results(); #@data=$sth->fetchrow_array(); while (@data = $sth->fetchrow_array() ) { print "Row: @data \n"; ($req,$ccode)=split(/ /,@data);