OK, your YYYY-MM-DD date format looks good; make sure the TO and FROM dates are formatted as strings the same way. The query:
or as Pratik suggested
As requested, here's a possible SQLiteDatabase query statement:
Where, naturally, you'd replace the selectionArgs strings with the values from your spinner and FROM and TO dates.I just noticed that your dates in the table shown do not have leading zeros in the month and day fields; you need these for the comparison to work correctly since you are actually comparing text strings. Note: "2011-09-10" < "2011-9-9" but "2011-09-10" > "2011-09-09" |
Free Android Tutorials, Android Tips, Android Developments, Free Android Codings., Free Android App Examples, Open Source Code for Android
Monday, 2 July 2012
How to display data between two dates based on android spinners selected item from sqlite db?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment