Skip to content Skip to sidebar Skip to footer

SQLite Selecting Date, With Different Date-format

I'm trying to select items by date, but their format is YYYY-MM-DD HH:MM:SS. I thought this would work (from other threads on stackoverflow), but it doesnt: String selectQuery = 'S

Solution 1:

date is a string literal and needs to be put in single quotes. Or better yet, use ? placeholder and bind arguments.

There's no syntax error since something like 2014-11-27 is a valid expression that evaluates to the integer 1976.


Post a Comment for "SQLite Selecting Date, With Different Date-format"