FORMAT (string_format, expression)


Returns the expression as a String with the specified formatting applied.


string_format The format to apply to the string using standard Microsoft formatting characters.
expression The number, string, or datetime value to format. expression can be:

— DateTime
— Decimal
— Double (any)
— Integer (any)
— String
— Unsigned Integer


A formatted String.


For information about valid formatting characters, see

Microsoft .NET String.Format Method for formatting of strings.

Microsoft .NET DateTime.ToString Method, Microsoft .NET Standard Date and Time Format Strings, and Microsoft .NET Custom Date and Time Format Strings for the formatting of DateTimes.

Microsoft .NET Int32.ToString Method for the formatting of numeric types.

Microsoft .NET Standard Numeric Format Strings and Microsoft .NET Custom Numeric Format Strings for all integral and floating-point types.

Microsft.NET Guid.ToString Method under Remarks for Guid values.

To apply numeric formatting or DateTime formatting to a string, you must use a conversion function such as TOINTEGER or TODOUBLE.

Related Topics

Text Functions

Data Conversion

Data Conversion Functions