Subject Re: [ib-support] Query question
Author Sindunata
Hi Nico,
how about using this kind of query:

to find the next number:

select min(itemno) from ...
where itemno > :currentno

to find the previous number:
select max(itemno) from ...
where itemno < :currentno

On Fri, Jun 01, 2001 at 09:44:45AM +0200, Nico Callewaert wrote:
> The problem is this procedure :
>
> procedure getNextRec;
> var currID: Integer;
> begin
> with mySingleQuery do
> begin
> currID := FieldByName ( 'ItemNo' ).AsInteger;
> ParamByName := currID + 1; <============================== + 1
> doesn't always work
> // with RefreshOnParamChange set to TRUE that should be all
> end;
> end;
>
> Nico
>