I want to SELECT a record FROM database WHERE the 'balance' is bigger than the number you type.
The regular sql is : SELECT cardNum FROM cardInfo WHERE balance > money ORDER BY withdrawals DESC, discount DESC.
But I have no idea how to do it in objective-C (to compare an integer with NSString in the 'WHERE' clause). The problem is that no NSInteger can be saved to FMDB tables.
here is part of my code:
NSString * moneyText = moneyField.text;
double money = [moneyText doubleValue];
NSString *selectedRecord = [db stringForQuery:@"SELECT cardInfo.cardNum FROM cardInfo WHERE (cardInfo.currentBalance ... I don't know what here is)ORDER BY withdrawals DESC]; (I want to get the first record only).
Is anybody who can help me?~ thank you!~