RSV-DR-0002 Unable to execute this request

Symptom
"RSV-DR-0002 Unable to execute this request"
"UDA-SQL-0213 The data type of an argument to an aggregate function is invalid."

Problem
In Query studio occurs this error when double-clicking a query item.

Cause
Datatype in the SQL server is different than expected.

Solution
The data type of this query item in MS SQL Server Enterprise Manager was changed to varchar(10) when it should be of type int. Changing it back to int resolved the error.