Tariq,
You can use sum(iif(mode="L",1,0)) as bagsLC to get your count, and sum(iif(mode="L",weight,0)) as bagsLS
>I want to get monthwise total of field weight
>to do this I use following codes
>
>SELECT MONTH(date) as nmonth,;
> CMONTH(date) as cmonth,;
> YEAR(date) as nyear,;
> sum(weight) as weight;
> from avlbook;
> GROUP BY nmonth,nyear ;
> ORDER BY nyear,nmonth;
> INTO CURSOR Temp
>
>This work fine for me, but now I want to get the total of bags feild with following condition
>
>count bags for mode="L" as bagsLc
>count bags for mode="B" as bagsBc
>
>sum(bags)for mode="L" as bagsLs
>sum bags for mode="B" as bagsBs