Thread: Locate on Max() and Group By

Locate on Max() and Group By

From
"A. Snelders"
Date:
I have the next problem:

I open an table with

select dnkey, Max(dvnaam) as dvnaam2, Max(dvpersoonnr) as dvpersoonnr   from
tbmedewerker
group by dnkey

When I want to locate like

    TblTbPGSMedew.Locate( 'dvnaam2', 'Hallo', [ ]);

then 'Hallo' isn't find

but when I open the table without Max() en group By like

select dnkey, dvnaam as dvnaam2   from tbmedewerker

then 'Hallo' is find.

How can I fixed this problem?
I working with PostgreSQL 7.1 and Delphi 5




Re: Locate on Max() and Group By

From
"A. Snelders"
Date:
I have found the answer:
In my ODBC-Driver by Driver, Optie Text as LongVarChar, this must be False
(I had True)
Now it works.

"A. Snelders" <asnelders@rem.nl> wrote in message
news:9miq6o$12el$1@news.tht.net...
> I have the next problem:
>
> I open an table with
>
> select dnkey, Max(dvnaam) as dvnaam2, Max(dvpersoonnr) as dvpersoonnr
from
> tbmedewerker
> group by dnkey
>
> When I want to locate like
>
>     TblTbPGSMedew.Locate( 'dvnaam2', 'Hallo', [ ]);
>
> then 'Hallo' isn't find
>
> but when I open the table without Max() en group By like
>
> select dnkey, dvnaam as dvnaam2   from tbmedewerker
>
> then 'Hallo' is find.
>
> How can I fixed this problem?
> I working with PostgreSQL 7.1 and Delphi 5
>
>
>



Re: Locate on Max() and Group By

From
Stephan Szabo
Date:
On Wed, 29 Aug 2001, A. Snelders wrote:

> I have the next problem:
>
> I open an table with
>
> select dnkey, Max(dvnaam) as dvnaam2, Max(dvpersoonnr) as dvpersoonnr   from
> tbmedewerker
> group by dnkey
>
> When I want to locate like
>
>     TblTbPGSMedew.Locate( 'dvnaam2', 'Hallo', [ ]);
>
> then 'Hallo' isn't find

Is 'Hallo' the maximum value for the group its in?  You may
want to turn up debugging to level 2 (I think that's the level)
so the queries sent get written to the log to see what's being
sent when you do the Locate().