| Sybase Data Conversion |
|
|
|
| Written by Steve Leonard | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Friday, 29 October 2010 08:31 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
see http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.blocks/html/blocks/blocks125.htmExamplesExample 1select title, convert(char(12), total_sales) Example 2select title, total_sales Example 3Converts the current date to style 3, dd/mm/yy: select convert(char(12), getdate(), 3) Example 4If the value pubdate can be null, you must use varchar rather than char, or errors may result: select convert(varchar(12), pubdate, 3) from titles Example 5Returns the integer equivalent of the string “0x00000100”. Results can vary from one platform to another: select convert(integer, 0x00000100) Example 6Returns the platform-specific bit pattern as a Sybase binary type: select convert (binary, 10) Example 7Returns 1, the bit string equivalent of $1.11: select convert(bit, $1.11) Date Format Conversion
Convert between data types or date formats.
Example: select convert( char(8), getdate(), 112 ) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Last Updated on Monday, 08 November 2010 21:10 |