How to Query Multi-Currency Fields in Salesforce SOQL?

To query multi-currency fields in Salesforce SOQL, wrap the currency field in convertCurrency() to get it in the user’s currency, use FORMAT() to show it with the right symbol, and filter with an ISO value such as Amount > USD5000. In Apex, give convertCurrency() an alias and read it with get('alias').

Most guides stop at the query. Below I also show what I tested in a Salesforce Developer Edition org: reading aliased values in Apex, where expr0 comes from, and what convertCurrency() does in an org without multiple currencies. The convertCurrency examples come from an org with multiple currencies enabled.

Before You Start: Multiple Currencies Must Be Enabled

convertCurrency(), the CurrencyIsoCode field and ISO values in WHERE clauses only work after an admin enables multiple currencies and adds the active currencies (see how to set up currencies in Salesforce). Enabling multiple currencies can’t be turned off again, so try it in a sandbox first. In my single-currency test org, a query using convertCurrency() stopped with this error, which a try/catch block did not stop:

Execute Anonymous error: System.UnexpectedException: currency conversion not supported in this organization

If your code runs in orgs of both kinds, such as a managed package, check User