Since they are synonyms for each other, I am going to use TO_CHAR in the rest of the article, but feel free to substitute VARCHAR_FORMAT in its place. In SQL we can use the VARCHAR_FORMAT or TO_CHAR (they are synonyms for each other – both work exactly the same way) scalar function to provide similar functionality. Something along the same lines as using the %EDITC or %EDITW built in functions in RPG or the EDTCDE or EDTWRD keywords in DDS. At times, when using an SQL select statement, you may want to format a number or date. In this article, I want to share with you an SQL scalar function that I happen to have been using quite a bit recently. Guru: Formatting Numbers and Dates/Times/Timestamps in SQL
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |