Querying datetime fields

I seem to be having problems with querying the database using the DATETIME fields. I have tried defining the whereClause of the query a number of ways but I always get all of the objects back whether their created date is before or after the specified date. Some of the formats that I have tried:

created >= 2014-01-10T16:54:00.000
created >= 2014-01-10 16:54:00 +0000

created >= 2014-01-10 16:54:00 GMT+0200

Changing the sign to “<=” stops any objects from coming back. Adding ‘’ around the date or # returns an “invalid where clause” error 1017.

Adding other variables to the search works fine.

I am using the latest SDK for iOS.

What am I missing?

Thanks for any help.

Hello Mark,

Thanks for the answer, that solved the issue.

Best regards
Igor

it’s a good idea to add this recipe to the manual

I am not getting this to work.

I have a table called “Tasks” and setting whereclause to

updated > ‘19700101000000’ OR updated IS NULL returns nothing.

Actually any query with updated returns nothing. updated IS NULL should work, as I haven’t updated anything…

Hi Igor,

At the present moment the format to express timestamps is: YYYYMMDDHHMMSS

We plan to make it a lot more flexible so the queries could look exactly as you specified, but for now you would need to use that specific format.

Regards,
Mark