Not an explanation to your problem, but you can use Reccount() instead of _tally in this case.
>Hi there,
>
>in myprogram I build this query:
>
>
>select kartei.* , RECNO() as satznr, kunden.vorname, kunden.name1, kunden.name2,
> kunden.name3, kunden.strasse, kunden.plz, kunden.ort from kartei inner join kunden
>on kartei.kundennr == kunden.kundennr where kartei.vormerker = .T.
>and (kartei.nummer == this.cIsbn) and not DELETED() into cursor myvormerker
>READWRITE order by best_dat DESC
>
>
>by assigning it to a var like
>
>cSelect = "Select...."
>
>And run it
>
>&cSelect
>
>Unfortunately this works only if I have more than one record fulfilling the conditions.
> If there is only one record matching it, _tally returns 0
>If I run the query in the command window, it works.
>Hay anybody some help für me?
>
>Best regards
>
>Thomas