>Fabio,
>
>It looks like a bug to me too.
>Another observation. According to ICASE() help the following 2 statements are similar but the second one generates an error. They both generate an error w/o COUNT()
>SELECT COUNT(ICASE(.F.,1)) FROM RUNROWS INTO CURSOR c2
>SELECT COUNT(ICASE(.F.,1, Null)) FROM RUNROWS INTO CURSOR c2
>
>
Infact, this is another effect of this bug.
But on the second VFP fire a error,
because it want a defined datatype for the COUNT() expression,
but this is another bug because COUNT() don't use the datatype,
is use only the NULL and NOT NULL values,
the result ( integer ) is defined in any cases.
If the exp must to have a datatype,
what is the "*" datatype ?
Example, this fire a error:
SELECT COUNT(NULL) FROM RUNROWS
but this don't fire a error ( count 1 numeric an 500 strings ),
It is correct,
because the not nullable values are 501:
CLEAR
CREATE CURSOR RUNROWS (F1 L)
INSERT INTO RUNROWS VALUES(.T.)
FOR K=1 TO 500
APPEND BLANK
NEXT
SELECT COUNT(IIF(F1,1000,'CHAR')) FROM RUNROWS
RETURN
This bad design is present into MS SQL too. Sin.