Subject Re: Better procedure for "horizontal table"?
Author rsaeger.edv@t-online.de
--- In ib-support@y..., Svein Erling Tysvær
<svein.erling.tysvaer@k...> wrote:
> Seems pretty OK to me, but then I don't know very much about SPs.
Do you
> have an index on (Work_Day, Emp_No)?
Yes, there are this indexes .

> I guess you could save a little bit by not calling EOM - after close
> examination I have found that it will always be the day before the
first of
> the following month ;-)
>
> HTH,
> Set
Yes, it is right. EOM returns the End Of Month date. I've found, that
WHERE DateField BETWEEN Date1 AND Date2 uses indexes, but EXTRACT
(MONTH FROM DateField) doesn't.

IMHO the problem isn't the call of EOM procedure, the problem is
twelvetimes SELECT SUM(... for every employee in the main-query, 100
employees = 1200 x SELECT SUM(... :-(

I'm thinking about this since 2 days, but I cannot find a better
solution.

Regards
Richard