Newer Version Available

This content describes an older version of this product. View Latest

FORMAT ()

Use FORMAT with the SELECT clause to apply localized formatting to standard and custom number, date, time, and currency fields.

When the FORMAT function is applied these fields reflect the appropriate format for the given user locale. The field format matches what appears in the Salesforce Classic user interface. For example, the date December 28, 2015 can appear numerically as 2015-12-28, 28-12-2015, 28/12/2015, 12/28/2015, or 28.12.2015, depending on the org’s locale setting.

This example is for an org that has multiple currencies enabled.
The FORMAT function supports aliasing. In addition, aliasing is required when the query includes the same field multiple times. For example:
You can also nest it with aggregate or convertCurrency() functions. For example: