Date Arithmetic in SQL or 4GL
Posted in 2003
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
For once I found the problem . Didnt realize that nMonthInt had to be YEAR
to MONTH. I had it declared as MONTH to MONTH.
MODIFY MODULE >>
DATABASE triptik
DEFINE e_recv_tm DATETIME YEAR TO DAY,
nCount int,
nMonthInt INTERVAL YEAR(2) to MONTH
MAIN
SET ISOLATION TO DIRTY READWHENEVER ANY ERROR STOP
WHENEVER WARNING STOP
LET nMonthInt = '1-06'
LET e_recv_tm = (CURRENT)
LET e_recv_tm = e_recv_tm - nMonthInt
DISPLAY "DATE IS :" , e_recv_tm
"Jack A" <InformixMail@yahoo.com> wrote in message
news:ce0e3c22.0308140534.474ace1a@posting.google.com...
> How is date arithmetic done in informix. I've been reading about an
> Interval type but cant find a single example. By date arithmetic I
> mean adding dates and subtracting dates. Which manual would have this
> information.
>
> TIA
How is date arithmetic done in informix. I've been reading about an Interval type but cant find a single example. By date arithmetic I mean adding dates and subtracting dates. Which manual would have this information. TIA
It's done by representing dates and times internally as a simple number. It's the number of milliseconds since the assasination of the Archduke Ferdinand, or something like that. Is this what you meant? But there are examples in the IDS Syntax and Tutorials manuals, which are available at www.ibm.com/informix somewhere. -- Neil Truby t:01932 724027 Director m:07798 811708 Ardenta Limited e:neil.truby@ardenta.com "Jack A" <InformixMail@yahoo.com> wrote in message news:ce0e3c22.0308140534.474ace1a@posting.google.com... > How is date arithmetic done in informix. I've been reading about an > Interval type but cant find a single example. By date arithmetic I > mean adding dates and subtracting dates. Which manual would have this > information. > > TIA