By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,378 Members | 3,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,378 IT Pros & Developers. It's quick & easy.

MS Access Date/Time Data type mismatch

P: n/a
I am receiving the following error:

MS Access Date/Time DBD::ODBC::st execute failed: [Microsoft][ODBC
Data type mismatch in criteria expression

when executing the following code.

$sqlstatement="SELECT [Import Date], [Transaction Type], [Item
Number]" .
"FROM [Open Transactions] WHERE [Import Date] > '2004/02/01
11:16:16'";

$sth = $dbh->prepare($sqlstatement);
$sth->execute ||
die "Could not execute SQL statement ... maybe invalid?";

The [Import Date] is defined as an MS Date/Time type and contains the
following Db entry format: 4/12/2004 9:22:37 AM

I've tried numerous literal values within the SELECT/WHERE but I am
having absolutely no luck with other formats as well as locating a
solution via the web.

Any help would be greatly appreciated!

Thanks!
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Access delimits dates with #, not '.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Jacquo Johnson" <ge******@hotmail.com> wrote in message
news:22**************************@posting.google.c om...
I am receiving the following error:

MS Access Date/Time DBD::ODBC::st execute failed: [Microsoft][ODBC
Data type mismatch in criteria expression

when executing the following code.

$sqlstatement="SELECT [Import Date], [Transaction Type], [Item
Number]" .
"FROM [Open Transactions] WHERE [Import Date] > '2004/02/01
11:16:16'";

$sth = $dbh->prepare($sqlstatement);
$sth->execute ||
die "Could not execute SQL statement ... maybe invalid?";

The [Import Date] is defined as an MS Date/Time type and contains the
following Db entry format: 4/12/2004 9:22:37 AM

I've tried numerous literal values within the SELECT/WHERE but I am
having absolutely no luck with other formats as well as locating a
solution via the web.

Any help would be greatly appreciated!

Thanks!

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.