Re: INTERVAL HOUR TO SECOND TO INTEGER
Posted in 1998
Gareth Edwards — — source: Informix-list mailing list archive (1991-1998)
Jonathan Leffler <jleffler@earthlink.net> wrote:
>Thomas J. Girsch wrote:
>> I know a similar question came up recently, but does anyone have
>> any idea how to convert an INTERVAL HOUR TO SECOND to INTEGER?
>
>When you said INTEGER, did you mean integer hours, minutes or seconds?
>I'm assuming you meant seconds. You use a stored procedure like I've
>shown in several examples in the last month:
>
>-- Untested code. The variable s is necessary; so is d.
[snip]
I needed this to perform a MOD(). I did pretty much the same as
Jonathan, but in the SELECT column list.
SELECT purge, MOD((purge::CHAR(5))::INT,30)
FROM NEWS_Prefs WHERE login='$who';
Regards,
Gareth
--
coming soon... SPONG