I have this SQL statement.The instruction works correctly but it sums and counts all table records.I want to do this but only with filetered records.Is it possible in the same instruction ?
Thanks in advance.
SELECT a.field1, a.field2, a.field3, a.field4 ;
FROM mytable a ;
SUM(a.field3) AS n_imp, ;
COUNT(a.field1) AS n_can ;
WHERE a.field2 = tcperiod ;
AND a.field3 = tcyear ;
ORDER BY a.field1 ;
INTO CURSOR myCursor
Thanks in advance