Subject RE: [firebird-support] Difficult to assign a subject title
Author Dion
I guess the question is how do you tell the SQl engine to take the current
invoicedate it is working with and find the max invoicedate excluding the
"current" one(ie the current invoicedate). This max invoicedate must surface
as the IntiHrs in the resultant dataset.

Thnaks.




-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Helen Borrie
Sent: 19 May 2006 04:23 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Difficult to assign a subject title

At 11:55 AM 19/05/2006, you wrote:
>Hi,
>
>
>
>How do I get the max invoice date less than the current invoice date in the
>dataset row the server is processing ie:-
>
>
>
> select max (hrsworked.invoicedate)
>
> from hrsworked
>
> where hrsworked.forkliftoid = :ForkliftOID and
>
> hrsworked.invoicedate < "the current invoicedate the sql server
is
>currently processing"

How long is a piece of string?

If there is a relationship between HrsWorked and the invoice whose
date you want to refer to, you could use a subquery expression - but
you don't provide enough information to permit an example.

If you have a set already in situ that has "the current invoice"
available, pick up its invoice date into a date/time variable, or
using a method**, and pass it to a parameterised statement, viz.

select max (hrsworked.invoicedate) as Max_HrsWorked
from hrsworked
where hrsworked.forkliftoid = :ForkliftOID and
hrsworked.invoicedate < :MyDateVariable

** e.g. the ParamByName.AsDateTime method available in many Delphi
components

./heLen




++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yahoo! Groups Links







--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.6.0/342 - Release Date: 17/05/2006


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.6.0/342 - Release Date: 17/05/2006