Add total to statement and sort by date