I need to calculate the total income between two dates(0+500).
//This is my android code
mDatabase.child(selected_account).orderByChild("Date").startAt(begin_date).endAt(end_date).
addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot snapshot, String s) {
Map<String, Object> newPost = (Map<String, Object>) snapshot.getValue();
if (newPost != null) {
if (newPost.get("Account") != null & newPost.get("Account") != "") {
foodList.add(new TransactionFlow
(newPost.get("Account").toString(),
newPost.get("Amount").toString(),
newPost.get("CashAtHand").toString(),
newPost.get("Variant").toString(),
newPost.get("Date").toString(),
newPost.get("DateTime").toString(),
newPost.get("Description").toString(),
newPost.get("Income").toString(),
newPost.get("Field").toString(),
newPost.get("Organisations").toString(),
newPost.get("Field").toString(),
newPost.get("key").toString(),
snapshot.getKey().toString()));
}
}
}
});
//I need to calculate the total of child income between two dates.,