Re: [?]Interval to decimal conversion: how.
Posted in 1995
cpilot (cpilot@teleport.com) wrote: : I can convert from decimal to interval, however I don't see any easy way : to convert back to decimal from interval. I expect I could put the : interval into a string then parse the string, but this just doesn't seem : elegant. You shouldn't have to parse the string, although you might have to do a bunch of operations on the decimal. For example, if you create a string of the format mm:ss.fff, you can assign it to an INTERVAL MINUTE TO FRACTION (3). So if your decimal is the number of seconds, you can divide by 60 to get minutes, and assign that part to your string (USING "##" or "&&" or something like that), add a ":", then take the remainder from your division and append it. Then simply: LET intvlvar = strvar That should work. June ---- June Tong Informix Asia/Pacific ---- ---- On-Loan Engineer Singapore ---- ---- Location-du-jour: Bangkok ---- ---- junet@informix.com (65) 298-1716 ----