Results 1 to 8 of 8

Thread: *RESOLVED* SQL statement "Type Mismatch" error

Threaded View

  1. #1

    Thread Starter
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674

    *RESOLVED* SQL statement "Type Mismatch" error

    I'm building sql on the fly based on user input. Everything works except this one that selects between two dates. I get the error: "Data type mismatch in criteria expression" at the line: rs.Open sql

    This is the sql statement:

    SELECT * FROM WOINFO WHERE (ConstDate BETWEEN "#4/1/2002#" AND "#4/30/2002#")

    I tried doing this with a variable because the field ConstDate is a Date field in the DB:

    SELECT * FROM WOINFO WHERE (ConstDate BETWEEN "#CDate(strCONDATE)#" AND "#CDate(strCONDATE2)#")

    But I still get type mismatch.

    If anyone spots something wrong with this any help is appreciated.

    JO
    Last edited by joltremari; Dec 4th, 2002 at 09:23 AM.
    "I have not failed. I've just found 10,000 ways that won't work."
    'Thomas Edison'

    "If we knew what it was we were doing it wouldn't be called research, would it?"
    'Albert Einstein'

    VB6

Posting Permissions

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



Click Here to Expand Forum to Full Width