>Boris thanks for your helpful reply. i got require result. But slow...not very slow but slow.
>Is sum command use for Numaric data and count for character.??
>Christian Ehlscheid codes are with sum but when i apply i have .nul.
Khubaib,
I don't know what you want to do.
Did you want to COUNT() all records that match 'category="H"'?
Or you want to COUNT() these records that match 'category="H"' and some other conditions?
If you want to calsulate ALL records records that match 'category="H"':
SELECT distinc b.date,b.code,b.category,;
SUM(IIF(b.category="H",1,0) AS CntField;
FROM dlyatten B;
INTO CURSOR temp
m.nYear = thisform.text1.Value
SELECT distinc b.date,b.code,b.category,;
SUM(IIF(b.category="H" AND year(date)=m.nYear,1,0) AS CntField;
FROM dlyatten B;
INTO CURSOR temp
But as I said I don't know what you want to do. Check to see if some of these exaples will work for you.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.