In a newly installed and initialized APM Remote, the user can do an initial download but cannot upload and download, nor upload. The user is presented with a the message "Unclosed quotation mark after the character string '%$aux'".
During investigation it was determined that the error message was the consequence of the Remote's database's ODBC DSN Datasource name being too long. A stored procedure was being truncated because when it generates it includes the database's ODBC DSN Datasource name and this was exceeding a character limit in the proceedure. The '%$aux' is actually the last 5characters of the truncated statement, different users will see different variations of this as their datasource names will be of different lengths.
Typically this is not an issue with most users as the recommended default datasource name is set as "IvaraRemote". So the best approach if you are experiencing this error is to update the ODBC System DSN datasource name used for the Remote database to "IvaraRemote", repackage APM Remote and redeploy.
https://communities.bentley.com/products/assetwise/asset_performance_management/w/wiki/39079/apm-remote-setup-fails-to-install-due-to-odbc-system-dsn-not-being-ivararemote