Query Currency Fields in Multicurrency Organizations
If an organization is multicurrency enabled, you can use convertCurrency() in the SELECTclause to convert currency fields to the user's currency.An organization has enabled advanced currency management, dated exchange rates will be used when converting currency fields on opportunities, opportunity line items, and opportunity history.
Syntax:
convertCurrency(field)
Example:
SELECT Id, convertCurrency(AnnualRevenue) FROM Account
You cannot use the convertCurrency() function in a WHERE clause. If you do, an error is returned. Use the following syntax to convert a numeric value to the user's currency, from any active currency in your organization:
Syntax:
Example:
Opportunity records will be returned if the record's currency Amount value is greater than the equivalent of
USD5000. For example, an opportunity with an amount of USD5001 would be returned, but not JPY7000.
Syntax:
WHERE Object_name Operator ISO_CODEvalue
Example:
Opportunity records will be returned if the record's currency Amount value is greater than the equivalent of
USD5000. For example, an opportunity with an amount of USD5001 would be returned, but not JPY7000.
SELECT Id, Name FROM Opportunity WHERE Amount > USD5000
Use an ISO code that your organization has enabled and is active. If you do not put in an ISO code, then the numeric value is used instead of comparative amounts. Using the example above, opportunity records with JPY5001, EUR5001, and USD5001 would be returned. Note that if you use IN in a WHERE clause, you cannot mix ISO code and non-ISO code values.