Re: How to Convert "Interval" --> Integer?
Posted in 1994
kenm@vcd.hp.com (Ken Miles) writes: >Is there a way in Online 5.0 SQL or in Stored Procedures to take a column >that is of type "interval second(7) to second" and convert it to an integer? >We have tables with some columns of type interval and want to display >their values in various data access tools none of which understand >what an Informix "Interval" data type is. Ideally, I'd like to convert >it in a view definition but there doesn't appear to be any such thing as: > select . . . int(table.interval column) . . . >that we can find documented. The short answer is something just discussed in converting DATETIMES to integer: Convert the INTERVAL into a CHAR, the convert the CHAR into an INTEGER. There may be away around the kludge step that requires the intermediate CHAR step, but I don't know it. Let me know if you need a more extensive example. ======================================================================= Dennis J. Pimple dennisp@informix.com Opinions expressed Senior Consultant -------------------- are mine, and do not Informix Software Inc Voice: 303-850-0210 necessarily reflect Denver Colorado USA Fax: 303-779-4025 those of my employer. Hey! last time I posted this suggestion, someone called me "ingenious"! Now I'm just being "repetitous".