www.webdeveloper.com
Results 1 to 3 of 3

Thread: query working in access but not through asp

  1. #1
    Join Date
    Sep 2003
    Posts
    649

    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?

  2. #2
    Join Date
    May 2005
    Posts
    502
    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?

  3. #3
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    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.

    Regards.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles