---
schema_version: "1"
id: cd2bca7c1a65b3e663ea655b864f17b63ead74324f55d07a752743da6c53c1f3
title: convertCurrency()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-soql-sosl/guides/soql-sosl/sforce-api-calls-sosl-querying-currency-fields.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-soql-sosl/guide/sforce-api-calls-sosl-querying-currency-fields.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ad9d01f93aa6322a739f85455edd1c2cfe8d40b2b435e320c6d949440286d436
products:
  - SOQL and SOSL Reference
  - Platform Developer Content
---

# convertCurrency()

Use `convertCurrency()` in a SOSL query to convert currency fields to the user’s currency. This action requires that the organization is multi-currency enabled.

Use this syntax for the `RETURNING` clause:

`convertCurrency(Amount)`

For example,

```soql
FIND {test} RETURNING Opportunity(Name, convertCurrency(Amount))

```

If an org has enabled advanced currency management, dated exchange rates are used when converting currency fields on opportunities, opportunity line items, and opportunity history. With advanced currency management, `convertCurrency` uses the conversion rate that corresponds to a given field (for example, `CloseDate on opportunities`). When advanced currency management isn’t enabled, the most recent conversion date entered is used.

You can’t 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 org.

```soql
WHERE Object_name Operator ISO_CODEvalue
```

For example:

```soql
FIND {test} IN ALL FIELDS RETURNING Opportunity(Name WHERE Amount>USD5000)
```

In this example, opportunity records are returned if the record’s currency `Amount` value is greater than the equivalent of USD5000. For example, an opportunity with an amount of `USD5001` is returned, but not `JPY7000`.

Use an ISO code that your org has enabled and made active. If you don’t put in an ISO code, the numeric value is used instead of comparative amounts. Using the previous example, opportunity records with `JPY5001`, `EUR5001`, and `USD5001` would be returned. If you use IN in a `WHERE` clause, you can’t mix ISO code and non-ISO code values.

**note:** Ordering is always based on the converted currency value, just like in reports. So, `convertCurrency()` can’t be used with the [ORDER BY Clause](https://developer.salesforce.com/docs/platform/salesforce-soql-sosl/guide/sforce-api-calls-sosl-select-order-by-with-limit.md).

The `convertCurrency()` function supports aliasing. In addition, aliasing is required when the query includes the same field multiple times. For example:

```nolang
FIND {Acme} RETURNING Account(AnnualRevenue, convertCurrency(AnnualRevenue) AliasCurrency)
```
