>Is there an explanation why RECCOUNT() doesn't return the right value in the following code ?
>
>
>create table t1 (f1 C(1))
>insert into t1 (f1) VALUES ("A")
>
>create table t2 (f1 C(1))
>insert into t2 (f1) VALUES ("B")
>index on f1 tag f1
>
>select "t1"
>scan
> SELECT * FROM t2 WHERE f1 = t1.f1 INTO CURSOR tmp
> ? reccount()
> ? _tally
>endscan
>
>
>RECCOUNT() returns 1 while it is supposed to return 0. This problem occurs only if you create an index on f1 in table t2. Without the index, it returns 0.
>
>Thanks.
Since no one really gave you the real answer to your question, just sugestions on how to handle it.. here goes.
reccount() is the record count of the CURRENT work area... which, as you can see from your code is t1...
The _tally tells you how many records are selected...
So, you are comparing two differnt values...
So... as someone said, prior to your reccount() you have to select tmp or pass the alias to reccount() ie. reccount('tmp')... if you do this they should match.
BOb