Also, I removed the row->0 if statement completely but still have the same problem - it looks like nothing is returned. This is what I have now:my $sth_1 = $dbh->prepare("SELECT sum(EMAIL_IRT),sum(DROP_CALL_COUNT), +sum(ANS_CALL_COUNT),sum(EMAILS_IN),sum(EMAILS_OUT) FROM CS_STATS WHER +E DATE_ADDED LIKE ?");
my $sth_1 = $dbh->prepare("SELECT sum(EMAIL_IRT),sum(DROP_CALL_COUNT), +sum(ANS_CALL_COUNT),sum(EMAILS_IN),sum(EMAILS_OUT) FROM CS_STATS WHER +E DATE_ADDED LIKE ?"); $sth_1->execute($date_1) or die "Couldn't get values from DB: " . DBI- +>errstr; $sth_1->execute(); my ($email_irt,$drop_call_count,$ans_call_count,$emails_in,$emails_out +); while (my @data = $sth_1->fetchrow_array()) { $email_irt = $data[0]; $drop_call_count = $data[1]; $ans_call_count = $data[2]; $emails_in = $data[3]; $emails_out = $data[4]; } print "$email_irt,$drop_call_count,$ans_call_count,$emails_in,
And this is the output:
Use of uninitialized value $email_irt in concatenation (.) or string a +t monthly_stat_mailer.pl line 88. Use of uninitialized value $drop_call_count in concatenation (.) or st +ring at monthly_stat_mailer.pl line 88. Use of uninitialized value $ans_call_count in concatenation (.) or str +ing at monthly_stat_mailer.pl line 88. Use of uninitialized value $emails_in in concatenation (.) or string a +t monthly_stat_mailer.pl line 88. Use of uninitialized value $emails_out in concatenation (.) or string +at monthly_stat_mailer.pl line 88. ,,,,
In reply to Re^2: Problem passing date to SQL
by JoeTheProgrammer
in thread Problem passing date to SQL
by JoeTheProgrammer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |