diff --git a/src/html/api/entry.php b/src/html/api/entry.php
index ff13390..2088b9f 100644
--- a/src/html/api/entry.php
+++ b/src/html/api/entry.php
@@ -17,7 +17,7 @@ class EntryAPI extends RestAPI {
$account=$this->_request['account'];
- $statement=$connection->prepare("select id, value_date, operation_date, label, value, account_id, sold, pointedSold from (select *, sum(value) over(order by value_date, operation_date, label desc, id desc) as sold, sum(value) over(partition by operation_date is not null order by value_date, operation_date, label desc, id desc) as pointedSold from entry where account_id=:account order by value_date desc, operation_date desc, label, id) as e where date_trunc('month', e.value_date) = :day ");
+ $statement=$connection->prepare("select id, value_date, operation_date, label, value, account_id, sold, pointedSold from (select *, sum(value) over(order by value_date, operation_date, label desc, value desc) as sold, sum(value) over(partition by operation_date is not null order by value_date, operation_date, label desc, value desc) as pointedSold from entry where account_id=:account order by value_date desc, operation_date desc, label, value) as e where date_trunc('month', e.value_date) = :day ");
$statement->bindParam("day", $day);
$statement->bindParam("account", $account);