logic to get expenses by date