It may be that the SELECT xxx statement immediately after the query is resetting _tally. There is no reason to issue a SELECT, since after the query runs the results set is the currently SELECTed work area. (Hilmar, I know it is not you, I'm just replying at this point).
Dana
>That's right, I overlooked the fact that you already used NOFILTER. reccount() should give you correct results in this case. The potential problem with _tally is that several commands might change its value - as Jaime explains, that might even happen within the query itself (perhaps by a UDF), but it may also be due to some other command you give later.
>
>For instance:
>
>
>select ... from ... into cursor ...
>count for 1 = 0
>? _tally
>
>
>The code as you posted it doesn't pose this problem, but you may have additional code which you didn't post.
>
>Hilmar.
Where's the damned Any Key?...too late