---
schema_version: "1"
id: 21fc325e06578a59fac178513911a1117800be9a742b399d631ed398ec95a237
title: Compare Values Between Fields in SOQL (Beta)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/release-notes/264-0-0/rn_api_soql_where.md
canonical_url: https://help.salesforce.com/s/articleView?id=release-notes.rn_api_soql_where.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 6dcb6d7bbdcdbbfcd8f1df00fbf2c89f306f9ad15a094e19068779adbc17db0e
description: Perform arithmetic calculations directly in a SOQL WHERE clause with the FORMULA() function. Use this functionality to compare values between fields without adding a formula field or post-processing logic, and write more efficient and expressive queries.
products:
  - Cross Cloud
release: "264"
---
# Compare Values Between Fields in SOQL (Beta)

Perform arithmetic calculations directly in a SOQL `WHERE` clause with the `FORMULA()` function. Use this functionality to compare values between fields without adding a formula field or post-processing logic, and write more efficient and expressive queries.

**Where:** This change applies to Lightning Experience and Salesforce Classic in Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com editions. The beta is available in sandbox, Developer Edition, and scratch orgs in API version 68.0 and later. It isn't available in production orgs.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-release-notes-salesforce_release_notes-264-0-0-production-enus/550ba85b-db1a-4608-9cd4-9a65ec96e1fa/images/icon_note.png)

Note Arithmetic formulas in a SOQL WHERE clause is a beta service that is subject to the Beta Services Terms at [Agreements - Salesforce.com](https://www.salesforce.com/company/legal/agreements/) or a written Unified Beta Agreement if executed by Customer, and applicable terms in the [Product Terms Directory](https://ptd.salesforce.com/). Use of this beta service is at the Customer's sole discretion.

#### See Also

- [_SOQL and SOSL Reference_: FORMULA()](https://developer.salesforce.com/docs/atlas.en-us.264.0.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_formula.htm)