mercredi 6 avril 2016

Select between dates SQLite

I am trying to write a query in my java program to select records between 2 dates. I have built my dates as such:

SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy", Locale.ENGLISH);
        Date parsed;
        try 
        {
            parsed = formatter.parse(sqlDateIn);
            java.sql.Date sqlDate = new java.sql.Date(parsed.getTime());
            returnDate = sqlDate;
        }

When I query the DB I get the attached. I cannot get the query to select any records (ie, between 01/01/15 and 12/31/15. I have tried all sorts of combos of strftime, but to no avail. I am a noob to java and sqlite, so I am sure it is a dumb user error. enter image description here

Aucun commentaire:

Enregistrer un commentaire