Back online The database encryption with the SQLite Sorcerer
Apr 11

AIR provides additionnal SQL features to support local SQLite databases. For example: dates.

So you can store dates directly in your SQLite database with no formatting. I think that pure SQLite databases would store dates in a text field after a transformation (to ISO format for example).

This is great but I had real difficulties to define a query with dates in the WHERE clause in all SQLite AIR admin tools.

After a few googling sessions and some tries in my SQLite Sorcerer, I found a way that works well.

select * from orders
where date(creationdate)>"2009-03-01";

Dates that are stored and retrieved by AIR have to be converted using the date function in the WHERE clause of the query. You can also add modifiers as localtime for instance.

dates in where clause query

 

This is maybe obviously obvious for SQL gurus but really not for me, so I wanted to share the information.

 

Related posts

Written by Arnaud
Creative Commons License
Tags: , , ,

Share/Save/Bookmark

Help me improve my blog by rating this post or sending a comment.

not goodquite goodgoodvery goodexcellent (No Ratings Yet)
Loading ... Loading ...


Comments are closed.