string sqlStatement = "select ID, Checkintime, RoomPrice, OrderNo from Orders where RoomType='" + selectedRoom.Key + "' and RoomNumber=" + selectedRoom.Value + " and Checkintime>="+dateOnly+" and CheckinTime<'"+endingTime+"'"; 
myAccessCommand = new OleDbCommand(sqlStatement, myAccessConn);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(myAccessCommand);
myDataAdapter.Fill(myDataSet, "Orders");
I have syntax error in the SQL statement line but I am not sure what went wrong that caused an syntax exception.