SQL FORMAT() Function

The FORMAT() Function

The FORMAT() function is used to format how a field is to be displayed.

SQL FORMAT() Syntax

SELECT FORMAT(column_name,format) FROM table_name;

 

Parameter Description
column_name Required. The field to be formatted.
format Required. Specifies the format.

Example

SELECT ProductName, Price, FORMAT(Now(),’YYYY-MM-DD’) AS PerDate
FROM Products;

 

No comments yet.

Leave a Reply

*