Re: Temp Calendar Table
Posted in 1999
Topics: Stored Procedures & SPL
define begin_date DATE;
define end_date DATE;
create temp table t_date( date_col DATE );
let begin_date = <first date>;
let end_date = <end date>;
while begin_date <= end_date
insert into t_date
values( begin_date );
let begin_date = begin_date + 1 units day;
end while
-----Original Message-----
From: nanson@paulweiss.com <nanson@paulweiss.com>
To: informix-list@iiug.org <informix-list@iiug.org>
Date: 20 '''''''' 1999 '. 19:58
Subject: Temp Calendar Table
>How can I build a temporary table that contains a record for each date of
the
>month for december? I already have the first and last day of the month
stored in
>variables. I'm using SPL for Informix 7.3
>
>
>Thanks
>
>
>
>
>__________________________________________________
>
>This message is intended only for the use of the Addressee and may
>contain information that is PRIVILEGED and CONFIDENTIAL.
>
>If you are not the intended recipient, you are hereby notified that any
>dissemination of this communication is strictly prohibited. If you have
>received this communication in error, please erase all copies of the
>message and its attachments and notify us immediately.
>
>Thank You.
>___________________________________________________
>
>
>
Something like this is a nice compact way of doing it, too:
select unique date("12/01/1999") + mod(tabid,31)
from systables