I’m trying to recover a date with SQLite on iOS.
This date (saved in selectedDate) is a variable NSDate. I convert NSDate to NSString (saved in dateString).
//Code:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat: @"yyyyMMdd"];
NSString *dateString = [formatter stringFromDate:selectedDate];
[formatter release];
NString *sentence = (@"SELECT description, date_from FROM Tasks WHERE date_from = %@", dateString);
//Warning: Expression result unused :(
If I put a default date, for example: SELECT… WHERE date_from = ‘20120719’, it runs. How can I solve it?
Sorry for my English 😉 Thanks!!!
have you try
LIKEis place of=?and