query working in access but not through asp
I have the following sql that i'm sending through an objconn.execute statement in asp
select orderid,[orderdate],[customerid],[internalcomments],[howpaid],[ordertotal],[status] from orders where orderdate>='11/2/2006' and orderdate<='28/2/2006'
not if i copy and paste directly into access then it works but if I run it through my webpage using asp I get an error -
Microsoft JET Database Engine error '80040e07'
Data type mismatch in criteria expression.
any idea what could be causing this?
Dates are a pain in the ass in MS Access
I can't remember off the top of my head but try #11/2/2006# instead of '11/2/2006'
Also, what are the square brackets for?
You should only need to the square brackets on reserved words in MS Access. "Status" wll ost likely need them, but the rest should be fine.
Using a hash instead of a single quote should suffice. You could also look into the date/time functions provided by Access.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)