How do I query games that are after a "visible" date? The dateformat is set:
FMDatabase *db = self.database;
if([self.database open]){
[db beginTransaction];
NSDateFormatter *formatter = [NSDateFormatter new];
[formatter setDateFormat:@"yyyy-dd-MM'T'HH:mm:ss'Z'"];
[db setDateFormat:formatter];
...
}
The table is created the following way:
[db executeUpdate:@"CREATE TABLE IF NOT EXISTS game (gameId Varchar(36) NOT NULL PRIMARY KEY,name TEXT,visibleFrom TEXT)"];
The query is executed the following way:
FMResultSet *results = [db executeQuery:@"SELECT * FROM game WHERE game.visibleFrom >= ?,[NSDate date]];
This returns nothing. When I use select * from game
then i get all the games. But I need the filtered result. Thanks in advance.