Subject Re: Difficult to assign a subject title
Author Adam
--- In firebird-support@yahoogroups.com, "Dion" <27824912424@...> wrote:
>
> >>If there is a relationship between HrsWorked and the invoice whose
date
> >>you want to refer to
>
> Hi Helen,
>
> Yes there is a relationship between HrsWorked and the invoice. I
need the
> resultant dataset to look as follows:-
>
> ForkliftOID InitHrs HrsWorked InvoiceDate
> 001 0 40 10/10/2006
> 001 40 100 10/11/2006 etc...
>
> On the 10/10/2006 the max invoicedate before the 10/10/2006 was
nul(hence 0
> as InitHrs). On the 10/11/2006, the max invoicedate before November
2006 was
> Oct 2006, hence the HrsWorked as InitHrs for the 10/11/2006 invoice
period.
>
> The max invoicedate prior to the current invoicedate serves as the
InitHrs
> for the current invoicedate being processed.
>
> I hope this clarifies things. Thanks, Dion.

Do you have a problem with using a stored procedure, because that
would be quite simple and more efficient to boot.

Adam