diff --git a/include/caosdb/transaction.h b/include/caosdb/transaction.h
index bb40a8e6f6f76812af6737352b1d03dec0e3824a..e2a2ebc2456de8294ce360434331ed4f710b1e75 100644
--- a/include/caosdb/transaction.h
+++ b/include/caosdb/transaction.h
@@ -364,7 +364,7 @@ public:
    * this transaction. In all other cases, the return value will be
    * -1.
    */
-  [[nodiscard]] inline auto GetCountResult() const -> int {
+  [[nodiscard]] inline auto GetCountResult() const -> long {
     return query_count;
   }