O
ollyculverhouse
Hi,
I connect to a mysql db with access.
I have a few date fields, these have been given the 'date' type in
mysql (yyyy-mm-dd) and are recognised by Access as date/time.
The dates display properly however my once working search function no
longer works. I always get 'Data type mismatch in criteria expression'.
I have recently changed the format of the date fields in mysql from
text to dates.
The table which has dates stored as text works fine, but the table
which has them stored as date/time (and so using my regional settings,
dd/mm/yyyy) now fails on the search.
I format all the dates (before searching mysql) into yyyy-mm-dd,
however it still comes up as data mismatch.
Const conJetDate = "yyyy\-mm\-dd"
myBookDate = Format(Me.Controls("lastBookDate"), conJetDate)
I then add it to the criteria string:
strWhere = strWhere & "([lastBookDate] = '" & myBookDate & "') AND "
I also print out the strWhere as a debug however it prints out
correctly:
([lastBookDate] = '2006-01-01')
Does access or Jet convert the date again in the background without me
seeing it?
I connect to a mysql db with access.
I have a few date fields, these have been given the 'date' type in
mysql (yyyy-mm-dd) and are recognised by Access as date/time.
The dates display properly however my once working search function no
longer works. I always get 'Data type mismatch in criteria expression'.
I have recently changed the format of the date fields in mysql from
text to dates.
The table which has dates stored as text works fine, but the table
which has them stored as date/time (and so using my regional settings,
dd/mm/yyyy) now fails on the search.
I format all the dates (before searching mysql) into yyyy-mm-dd,
however it still comes up as data mismatch.
Const conJetDate = "yyyy\-mm\-dd"
myBookDate = Format(Me.Controls("lastBookDate"), conJetDate)
I then add it to the criteria string:
strWhere = strWhere & "([lastBookDate] = '" & myBookDate & "') AND "
I also print out the strWhere as a debug however it prints out
correctly:
([lastBookDate] = '2006-01-01')
Does access or Jet convert the date again in the background without me
seeing it?