Heya Gang -
I need to select ONLY the Month from a Query in mysql. Assuming that date is a date stamp, in a DB called open. and i want to return all months that are Jan (or 01). Im lost please help. Here's my code:
my $dsn = "DBI:mysqlPP:TTCOpen:$DB::SERVER";
my $dbh = DBI->connect($dsn, $DB::USER, $DB:ASS);
my $sth = $dbh->prepare(qq{ SELECT date FROM open WHERE callinby = '01'});
$sth->execute();
while (($TT::NUMBER) = $sth->fetchrow_array())
{ $STAFF::OPEN = $STAFF::OPEN + 1; $TOTAL::OPEN = $TOTAL::OPEN + 1; }
$sth->finish();
$dbh->disconnect();
I need to select ONLY the Month from a Query in mysql. Assuming that date is a date stamp, in a DB called open. and i want to return all months that are Jan (or 01). Im lost please help. Here's my code:
my $dsn = "DBI:mysqlPP:TTCOpen:$DB::SERVER";
my $dbh = DBI->connect($dsn, $DB::USER, $DB:ASS);
my $sth = $dbh->prepare(qq{ SELECT date FROM open WHERE callinby = '01'});
$sth->execute();
while (($TT::NUMBER) = $sth->fetchrow_array())
{ $STAFF::OPEN = $STAFF::OPEN + 1; $TOTAL::OPEN = $TOTAL::OPEN + 1; }
$sth->finish();
$dbh->disconnect();