Re: How to convert Integer to ASCII
Posted in 2000
Mark Would this work? ' '||MONTH(CURRENT)||YEAR(CURRENT) Not familiar with the SUBSTRING function in the form you are using, but since you are not getting errors on this, its probably supported...I use... SUBSTRING(exprtext,48, 5), instead of SUBSTRING(exprtext FROM 48 for 5), HTH Sujit mark.baumgartner@cardhealth.com on 08/23/2000 12:35:34 PM To: "'informix-list@iiug.org'" <informix-list@iiug.org> cc: Subject: How to convert Integer to ASCII Anyone know how to convert and integer value to character (without call a C program)? In a stored procedure the below query is failing with "-1213 A character to numeric conversion process failed." on the MonthYear variable. SELECT SUBSTRING(exprtext FROM 19 for 5), SUBSTRING(exprtext FROM 48 for 5), dbspace, SUBSTRING(dbspace FROM 1 for 4), MONTH(CURRENT)||YEAR(CURRENT), CASE WHEN MONTH(CURRENT) IN (1,3,5,7,8,10,12) THEN "31" WHEN MONTH(CURRENT) IN (4,6,9,11) THEN "30" ELSE "29" END INTO LessThanDateInt, --INT GreaterThanDateInt, --INT DBSpaceName, --CHAR DBSpaceDevice, --INT MonthYear, --CHAR DaysInMonth --CHAR FROM sales_tran_frags Where DATE(TRUNC(SUBSTRING(exprtext FROM 19 for 5))) in ( select MIN(DATE(TRUNC(SUBSTRING(exprtext FROM 19 for 5)))) from sales_tran_frags ); Thanks for any help. Mark