I'm executing an SQLite query:
String selectQuery = "SELECT hotel.cityName, hotel.hotelName, hotel.roomName, hotel.roomCode, hotel.roomType, hotel.maxPax FROM hotel WHERE ( hotel.cityName = 'Adelaide' OR hotel.cityName = 'Brisbane' OR hotel.cityName = 'Canberra' ) AND hotel.maxPax < 200 AND hotel.maxPax >= 100 AND ( hotel.roomType = 'Boardroom' )"
against a database table called "hotel" created from XML, with the following headings (according to DDMS):
id (INT)
cityName (TEXT)
hotelName (TEXT)
roomCode (TEXT)
roomName (TEXT)
roomType (TEXT)
maxPax (INT)
Each time I run the query:
SQLiteDatabase db = this.getWritableDatabase ( );
Cursor cursor = db.rawQuery ( selectQuery, null );
cursor.getCount() returns 0.
I have checked the actual data, and this query should definitely return data. Why does cursor.getCount() return 0?