What do you mean "not work"? What do you get for a result? What do you want the result to be?
>hi all,
>i tray via this code under to sum my filed ,not work
>
>is ther a way to insert the fields to new table qtmp as
>
>stk_code sum of month1 ... to month12 + another fileds.
>
>
>SET DATE BRITISH
>SET CENTURY on
>LOCAL ldStart, ldEnd
>ldStart =ctod("01/01/2006")
>ldEnd = ctod("31/12/2006")
>
>
>SELECT stk_code,trn_type,trn_date,cst_prce,str_nmbr, SUM( trn_qnty ) AS bill_total FROM test WHERE ;
> between(trn_date,ldStart,ldEnd) AND trn_type=44;
> GROUP BY stk_code,trn_type,trn_date,cst_prce,str_nmbr ;
> ORDER BY stk_code,trn_date INTO table qTmp readwrite
>USE qTmp
>*INDEX ON ctod(trn_date) + (stk_code) TO ll
>
>BROWSE
>
>
>thanks alot