I would like to know why the data can't append to the output file from the
script below:
**
close databases
set date to british
set safety off
set century on
set cpdialog off
set talk off
set defa to c:\GP\utilities
set path to c:\GP\utilities
startday=ctod("01/09/2007")
endday=ctod("03/09/2007")
inpath = "D\Source\"
USE ABC_Count
ZAP
in_date = startday
DO WHILE in_date <= endday
?in_date
wdate = DTOC(in_date,1)
wdd = SUBSTR(wdate,7,2)
wmm = SUBSTR(wdate,5,2)
wyy = SUBSTR(wdate,1,4)
filename = inpath + wyy + wmm + "\" + wyy + wmm + wdd + "-stock.dbf"
use &filename in select(1) alias a
select a.date,a.location,a.stock,ud.type, ;
sum(iif(a=1)) as stockAcount, ;
sum(iif(b=0)) as stockBcount, ;
from a;
group by a.location;
into table a1
APPEND FROM a1 FOR (stock= 'A')
REPLACE bdate WITH in_date FOR EMPTY(bdate)
in_date=in_date+1
ENDDO
copy to stock.csv type xls
close database