I am automating the analysis of sales from 2 retail outlets. The relevant files are downloaded in the early hours of the morning and reside on the machine of the main branch. So far so good but here is the problem.
The two dbf files which have the same name are stored in seperate directories.
The following code processes the data of one single dbf file, adds up the individual totals and puts the result into a cursor.
What I would like to do, if it is possible, is combine the results of both tables into a common report but keep the individual shop details seperate. Is it possible to do it with a single query, or will I have to combine the two tables first. I would appreciate your thoughts as to suggested methods.
Thanks in advance
Keith
The two dbf files which have the same name are stored in seperate directories.
The following code processes the data of one single dbf file, adds up the individual totals and puts the result into a cursor.
Code:
SELECT DAYSALES.Code,SUM(DAYSALES.Qty) AS TQTY,ASTOCK.Product;
FROM Z:\ASTOCK.DBF ASTOCK INNER JOIN Z:\DAYSALES.DBF DAYSALES ON ASTOCK.CODE = DAYSALES.CODE;
WHERE DAYSALES.Qty>0 AND DAYSALES.DATE>=DATE()-DAYZ AND LEFT(DAYSALES.CODE,1)=CHR(NUM);
ORDER BY DAYSALES.Code;
GROUP BY DAYSALES.CODE;
INTO CURSOR SHOP
Thanks in advance
Keith