Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
dev:sql:functions:convert [2010/07/27 21:16]
els
dev:sql:functions:convert [2010/07/27 22:53]
els
Line 28: Line 28:
  
 == options == == options ==
 +
 +Optional. ​ Options can be applied to the data conversion to affect the output. ​ The supported options are:
 +
 +^Option ​ ^Description ​                                  ^
 +|LJ      |Left-justify ​                                 |
 +|RJ      |Right-justify ​                                |
 +|UPS     ​|Upshift ​                                      |
 +|DNS     ​|Downshift ​                                    |
 +|SF      |Space-fill ​                                   |
 +|ZF      |Zero-fill ​                                    |
 +|BWZ     ​|Blank when zero                               |
  
  
Line 47: Line 58:
 </​code>​ </​code>​
  
 +==== Example 2: $CONVERT with options ====
 +
 +<​code>​
 +> select $convert(name,​ '​char(50)',,'​rj dns') name_rj from individuals;​
 +
 +NAME_RJ
 +--------------------------------------------------
 +                                    ms. mary lewis
 +                             mrs. alice r tolliver
 +                             mr. sidney k tolliver
 +                           mrs. jennifer j hopkins
 +                               mr. charlie hopkins
 +                                 ms. kimberly blue
 +                                   ​kathleen tucker
 +</​code>​
  
 ====== Additional Resources ====== ====== Additional Resources ======
 
Back to top
dev/sql/functions/convert.txt ยท Last modified: 2016/06/28 22:38 (external edit)