finni has asked for the wisdom of the Perl Monks concerning the following question:
This only returns things that are NULL in ClearDate, not things that were cleared today. I've tried playing with different UnixDate formats, and that gave the same (incomplete) results. I tried encasing the date in Access-style #, but that bombed with DBS::ODBC errors. I'm not making much headway here; I'd love some hints.use Win32::ODBC; use DBI; use Date::Manip; &Date_Init("TZ=EST"); my $now = localtime(); my $start_date = &UnixDate(&ParseDate("$now"), "%m%/%d%/%Y"); $sqlstatement= qq ( SELECT WorkOrd.WO2, WorkOrd.ClearDate from WorkOrd where WorkOrd.StatCode5 = 'C' and ( WorkOrd.ClearDate is NULL or ( WorkOrd.ClearDate = ? ) ) ); $sth = $dbh->prepare($sqlstatement) or die "Could not prepare stateme +nt. Error:$sth->errstr()\n"; $sth->execute($start_date) or die "Could not execute statement. Error +:$sth->errstr()\n"; $sth->bind_columns( \$WO2, \$ClearDate );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD::ODBC, Access, date comparisons
by dga (Hermit) on Mar 20, 2003 at 16:22 UTC | |
by finni (Beadle) on Mar 20, 2003 at 16:30 UTC | |
by dga (Hermit) on Mar 20, 2003 at 16:44 UTC | |
by finni (Beadle) on Mar 20, 2003 at 17:13 UTC | |
by finni (Beadle) on Mar 20, 2003 at 16:41 UTC | |
|
Re: DBD::ODBC, Access, date comparisons
by finni (Beadle) on Mar 20, 2003 at 18:12 UTC | |
by Anonymous Monk on Aug 08, 2003 at 08:18 UTC |