in reply to Re: Date Problem
in thread Date Problem

my $SQL = "Select tran_seq_nbr, sale_amount From KCPOS_Tran_Header Where org_number = $ai_div And store_number = $ai_store And tran_number = $al_trans And terminal_number = $ai_reg And tran_Date = $adt_h_date"; my $sth = $dbh->prepare( $SQL ) or die "Couldn't prepare statement: " . $dbh->errstr; $sth->execute() or die "Couldn't execute statement: " . $sth->errstr; ( $ac_seq_nbr, $ac_sale_amount ) = $sth->fetchrow();

This what i am doing

Replies are listed 'Best First'.
Re^3: Date Problem
by marto (Cardinal) on Apr 26, 2010 at 10:59 UTC

    I don't know where you're getting the contents of $adt_h_date, but did you read the section on placeholders from the DBI docs? You want to use placeholders to protect against SQL injection. I'd suggest looking this up in the documentation.

Re^3: Date Problem
by nagalenoj (Friar) on Apr 26, 2010 at 10:36 UTC
    I think the problem is because of not quoting the date value($adt_h_date) in the query preparation.