>Sorry, I don't think that you resolved my problem.
>Perhaps I didn't explain it well:
>I have the problem with my old way (_tally) and the problem resolved when I started to use with the new way (reccount()).
>My question was why my old way stopped to work and _tally started to return (sometimes) the value 0 even that there is a lines in the cursor.
>
>PS
>As you can see I used with 'noilter'.
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.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)