MS AccessFormat() Function
Example
Format the "Price" column to Currency:
SELECT Format(Price, "Currency") AS FormattedPrice
FROM Products;
Try it Yourself »
Definition and Usage
The Format() function formats a value with the specified format.
Syntax
Format(value,format)
Parameter Values
| Parameter | Description |
|---|
| value | Required. The string to format |
| format | Optional. The format to to use.
| Format | Description |
|---|
| General Number | Indicates a number, without thousand separators | | Currency | Indicates currency, with thousand separators and two decimal places | | Fixed | Shows minimum one digit to the left of the decimal place and two digits to the right of the decimal place | | Standard | Shows the thousand separators + minimum one digit to the left of the decimal place, and two digits to the right of the decimal place | | Percent | Shows a percent value (with percent sign) and two digits to the right of the decimal place | | Scientific | Indicates scientific notation | | Yes/No | Shows No ifvalue = 0 and Yes ifvalue <> 0 | | True/False | Shows False ifvalue = 0 and True ifvalue <> 0 | | On/Off | Shows Off ifvalue = 0 and On ifvalue <> 0 | | General Date | Showsvalue as a date based on the system settings | | Long Date | Showsvalue as a date based on the system's long date settings | | Medium Date | Showsvalue as a date based on the system's medium date settings | | Short Date | Showsvalue as a date based on the system's short date settings | | Long Time | Showsvalue as a date based on the system's long time settings | | Medium Time | Showsvalue as a date based on the system's medium time settings | | Short Time | Showsvalue as a date based on the system's short time settings |
|
Technical Details
| Works in: | From Access 2000 |
|---|