I have an SQLite table that has among its few fields, one field called DATE defined as a TEXT field and formatted as: M/dd/YYYY in the table. I would like to export a portion of the table data to a text file using a date range. The START and END dates are entered in 2 textedit views. I would like to use a SQL statement such as:
SELECT * FROM MyTable WHERE DATE between StartDate.text and EndDate.text
I also tried: SELECT * FROM MyTable WHERE DATE >= StartDate.text and DATE <= EndDate.text
I have been struggling with this for more than 2 days, although I can do this in Microsoft Access in seconds. I tried to include julianday, datetime.Dateparse in the SELECT statement, but it crashes with every combination. I hope someone has done it and can shed some light on this big dilemma. I am finding out SQLite and B4A do not mix very well. Here is a sample of similar data:
ITEM DATE DEPTH COMMENT
1456 1/2/2012 56 Stable
2767A 12/30/2011 34 Erratic
5623 1/7/2012 109 exceeds limit
1456 1/10/2012 76 improving
Thank you
SELECT * FROM MyTable WHERE DATE between StartDate.text and EndDate.text
I also tried: SELECT * FROM MyTable WHERE DATE >= StartDate.text and DATE <= EndDate.text
I have been struggling with this for more than 2 days, although I can do this in Microsoft Access in seconds. I tried to include julianday, datetime.Dateparse in the SELECT statement, but it crashes with every combination. I hope someone has done it and can shed some light on this big dilemma. I am finding out SQLite and B4A do not mix very well. Here is a sample of similar data:
ITEM DATE DEPTH COMMENT
1456 1/2/2012 56 Stable
2767A 12/30/2011 34 Erratic
5623 1/7/2012 109 exceeds limit
1456 1/10/2012 76 improving
Thank you