Re: getting more rows out of a table
Posted in 2005
A nice simple way is to just create a 'dates' table with all valid dates (say
(today - 10 years) to (today + 10 years) ?)
You can populate it easily with 4GL/ ESQLC etc.
Then use than in your query.. (This has the advantage that you can index the
table), something like:
select * from yourtable,dates
where dates.dt between start_date and (start_date+nights-1)
On Friday 29 July 2005 15:49, gingerafro wrote:
> I currently have a table showing data for hotels with fields such as:
> day_no
> start_date
> nights
>
> Now, the table does not list every night stayed, just the checkin and
> number of nights stayed.
> I need to show every day in a report, and also do some calculations on
> it. I can get the information on the screen using a FOR statement in
> the FORMAT section, but then I can't do the calculations.
>
> Can I use a FOR statement in SELECT? If so, how. Or if not, got any
> smart ideas???
--
Mike Aubury
sending to informix-list