FORMAT

Description

Returns a value formatted with the specified format and optional culture (FORMAT in Transact-SQL).

Sample Source Pattern

Syntax

FORMAT( value, format [, culture])

Arguments

value: String expressions to give format.

format: Desired format.

culture (Optional): NVarchar argument specifying culture. If it is not specified, takes the languages of the current session.

Return Type

NULL if the culture parameter is invalid, otherwise, it follows the next data types:

Examples

SELECT FORMAT(CAST('2022-01-24' AS DATE), 'd', 'en-gb')  AS 'Great Britain';
SELECT FORMAT(244900.25, 'C', 'cr-CR')  AS 'CURRENCY';

Last updated