>When I run the following
>
>Select cField, iif(Lexp,'Y','N'), COUNT(*) from table group by 1,2
>
>It groups by the iif statement properly, but populates all of the second field with the .f. iif value--'N'. The exception is when the group of field1 only has representatives of the .t. iif value, and then populates the one field with 'Y'.
>
>I frequently use IIF in SQL and occassionally run into this problem. Does anyone know why?
>
>Thanks in advance for your assistance.
Try:
SELECT cField, IIF(lExp,'Y','N') AS lExpStatus, COUNT(*) AS counter FROM table GROUP BY 1,2
Your result set contains columns: cField, lExpStatus, counter that you could be based upon whatever you want to do after the statement.
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net
CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."