WG: date + interval: How ??
Posted in 2000
You should declare the column duration as "interval hour to second". The
sence of this column is a time interval and not the time. You say in english
"5 o'clock" and "5 hours" - these are absolutely different things.
Best regards
- Denis
> ----------
> Von: Loven, Isaac[SMTP:Isaac.Loven@team.telstra.com]
> Gesendet: Mittwoch, 16. August 2000 10:44
> An: informix-list@iiug.org
> Betreff: date + interval: How ??
>
> Help Please !!
>
> I created a table test_tb and inserted one row of data as shown below.
>
> How do I calculate the end_time ??????????
>
> (If I can get the select working below than I will change it into an
> update
> statement .)
>
> After speeding about 4 hours of RTFM ( all 3 sql manuals ) , searching the
> faq of
> of this group (IIUG ) and trying many many many different syntax
> combinations, I am ready to pull my
> hair out :-(
>
> _________________________________________________________
> create table test_tb
> (
> start_time datetime year to second,
> duration datetime hour to second,
> end_time datetime year to second
> );> _________________________________________________________
>
> select * from test_tb>
> start_time 2000-07-17 21:15:00
> duration 01:35:00
> end_time
>
> 1 row(s) retrieved.
> _________________________________________________________
> This bellow does not work:
> _________________________________________________________
> select
> datetime ( start_time ) year to second + interval(duration) hour to
> second
>
> from test_tmp;
>
> Database selected.
>
> 201: A syntax error has occurred.
> Error in line 2
> Near character position 39>
> Database closed.
> ( It does not like the plus )
>
> How should I do this start_time + duration calculation ?????????
>
> Thanks,
> Isaac
> ______________________________
> Isaac Loven.
>