RE: Manipulating Interval Datatypes
Posted in 1999
You can do something like this:
create temp table x (a0 interval second(4) to second);
create temp table y (a1 datetime hour to second, a2 datetime hour tosecond);
insert into y values ("01:33:40", "00:58:32");
insert into x select a1 - a2 from y;
select * from x;
My engine accepts up to second(9) to second, should be enough
Alternatively, I've also taken the more brute force approach of coercing the
interval into
a char variable, then breaking that apart and adding up the pieces
> -----Original Message-----
> From: Richard Auslander [SMTP:rich@airflash.com]
> Sent: Wednesday, November 17, 1999 3:54 PM
> To: informix-list@iiug.org
> Subject: Manipulating Interval Datatypes
>
> Folks -
>
> (IDS 7.30UC5 on Solaris)
>
> I've pored through the Informix docs, and am coming up baffled. I am
> subtracting two datetime (year to second) fields to produce an Interval
> field. I'm looking for a way to convert this interval (which includes
> minutes and seconds) to either all seconds or an integer value
> representing those seconds. Thanks!
>
> Rich
> --
> Richard C. Auslander
> Database Manager
>
> AirFlash, Inc.
> 1733 Woodside Rd., Suite #110
> Redwood City, CA 94061
> (650) 556-7928
>
> www.airflash.com
>