sqldatems-accessopenoffice-base

Are my dates strings?


I using Open Office to create an .odb database that is connected to an Access database, but I am having a hard time querying dates in the .odb database.

Here is an entry from the DATE column: 02/11/13 12:00 AM
(The column is actually called 'DATE')

How would I query this?

This is what I have tried:

ERROR:Data type mismatch in criteria expression.

SELECT *
FROM PHAII01 
WHERE DATE = '02/11/13 12:00 AM'

ERROR: Syntac error (missing operator) in query expression 'DATE=02/11/13 12:AM'.

SELECT *
FROM PHAII01 
WHERE DATE = 02/11/13 12:00 AM

RETURNS NOTHING

SELECT *
FROM PHAII01 
WHERE DATE = 02/11/13

ERROR: Data type mismatch in criteria expression

SELECT *
FROM PHAII01 
WHERE DATE = '02/11/13 12:00 AM'

RETURNS NOTHING

SELECT *
FROM PHAII01 
WHERE DATE = 2013/02/11

Solution

  • Try it like this:

    SELECT *
    FROM PHAII01 
    WHERE DATE = #02/11/13 12:00 AM#
    

    or like this

    SELECT *
    FROM PHAII01 
    WHERE DATE = CDate('02/11/13 12:00 AM')