473,385 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

MS Access Date/Time Data type mismatch

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
1 2055
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: D | last post by:
Guys, i had try to update the "Date" value in my access to empty string. The data type for the column value is Date/Time. I use the following simple code: rsForum ("Date") = "" It give me...
1
by: Ken | last post by:
I wrote a function to use in queries that takes a date and adds or subtracts a certain length time and then returns the new value. There are times when my function needs to return Null values. ...
1
by: Jacquo Johnson | last post by:
I am receiving the following error: MS Access Date/Time DBD::ODBC::st execute failed: , , " . "FROM WHERE > '2004/02/01 11:16:16'"; $sth = $dbh->prepare($sqlstatement); $sth->execute ||...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
2
by: Giulio | last post by:
I make an import of a huge file txt table with headers at each page and date format as "20.12.2004" in order to use the data I first qo a query that exclude all line representing the headers...
2
by: Brian Henry | last post by:
is there info about data type conversions between access to ado.net? I have tried a lot of the ones that say oledb data types should work for and get a lot of "data type mismatch" errors using...
1
by: nagi28 | last post by:
Hi All, I am executing a select query which involve join between three tables through jdbc. I am using MS-ACCESS as database. This query needs to get the data based on some conditions on date...
2
by: tmoon3 | last post by:
Hello, This must be a simple mistake, but for some reason I cannot seem to get around it. I am simply trying to create a report of all employees that have a date filled in in a training column...
3
by: shivasusan | last post by:
Hi! I am using for my project ASP and Microsoft Access. start date and end date -- In database (Microsoft Access) i set the datatype is Date/Time. It's display error. The error is below:...
2
by: shivasusan | last post by:
Hi! when i pass the data to my database MS-Access. i got error. Error Type: Microsoft JET Database Engine (0x80040E07) Data type mismatch in criteria expression....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.