lundi 28 septembre 2015

SQLite DateTime Comparison With VARCHAR

I got some problem with SQLite DataTime Filtering. I used System.Data.SQLite in my wpf project. i can filter using the following sql query.

SELECT * FROM tblTest WHERE CAST(testDate As date) > CAST('28/09/2015' As date);

According to above sql, i get all the dates bigger than 28/09/2015. btw testDate field is Varchar data type in my sqlite table.

When i use 'BETWEEN' statement. i got nothing.

SELECT * FROM tblTest WHERE CAST(testDate As date) BETWEEN CAST('28/09/2015' as date) AND CAST('10/10/2015' as date);

How should i filter date in between? Thanks for anyhelp.

Aucun commentaire:

Enregistrer un commentaire