Re: INTERVAL FUNCTION
Posted in 2003
Topics: General Discussion
tomL wrote:
> Hello,
> I am unsure of why this function behaves like it does (or more
> accurately, what the sql means)?
> create_date is a DATETIME YEAR TO SECOND
>
> select * from request where> create_date <= EXTEND(current, year to second) - interval (99) second
> to second
>
> why does the above statement work but when i replace 99 with 100, it
> fails?
Because you need to alter the precision of the INTERVAL to SECOND(3).
> as i increase the number of seconds in the interval, i am required to
> change the sql to this:
>
> select * from request where
> create_date <= EXTEND(current, year to second) - interval (18000)> second (5) to second
>
> what does the (5) mean and why do i have to increase it as i increase
> the interval seconds? the above sql will fail if it is a (4) instead
> of a (5).
The 5 is the precision and indicates the number of digits.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /|
| Mydas Solutions Ltd http://MydasSolutions.com |///// / //|
| +-----------------------------------+//// / ///|
| |We value your comments, which have |/// / ////|
| |been recorded and automatically |// / /////|
| |emailed back to us for our records.|/ ////////|
+----------------------+-----------------------------------+-----------+
sending to informix-list
Mark D. Stock wrote: > tomL wrote: >> >> why does the above statement work but when i replace 99 with 100, it >> fails? > > Because you need to alter the precision of the INTERVAL to SECOND(3). Don't you mean: "What do IBM Informix tech support say?" -- I have a simple philosophy that gets me through life: Never buy cheap toilet paper. Know what is important, and what is not important. - Replies directly to this message will go to an account that may not be checked for a week or two. For more timely e-mail response, use (only in an emergency) ahamm sanderson net au with all the usual punctuation.