23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

TO_CHAR<br />

TO_CHAR<br />

Syntax<br />

132<br />

• expression must evaluate to an approximate numeric data type.<br />

• To convert degrees to radians, multiply degrees by Pi/180. To convert radians to degrees,<br />

multiply radians by 180/Pi.<br />

Compatibility<br />

ODBC compatible<br />

Converts the given expression to character form and returns the result. The primary use for<br />

TO_CHAR is to format the output of date-time expressions through the format_string argument.<br />

expression<br />

Converts to character form. It must evaluate to a value of the date or time data type to use<br />

the format_string.<br />

format_string<br />

Specifies the format of the output. <strong>SQL</strong> ignores the format string if the expression<br />

argument does not evaluate to a date or time.<br />

Notes • The first argument to the function can be of any type.<br />

TO_DATE<br />

Syntax<br />

TO_CHAR ( expresion [ , format_string ] )<br />

• The second argument, if specified, must be of type CHARACTER.<br />

• The result is of type CHARACTER.<br />

• The format argument can be used only when the type of the first argument is DATE.<br />

• If any of the argument expressions evaluates to NULL, the result is NULL.<br />

Compatibility<br />

Progress extension<br />

Converts the given date literal to a date value.<br />

TO_DATE ( date_literal )<br />

Example This example illustrates the TO_DATE function, returning all columns from rows in the orders<br />

table where the order_date column is earlier or equal to the date ‘12/31/2003’:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!