General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hi Naomi
Please Help me to Join Two Query
SELECT opmrp.entno as itementno, ;
VAL(opmrp.batch) as batch ,;
opmrp.date as batchdate, ;
VAL(opmrp.qty) as opqty , ;
SUM(VAL(sld.qty)) as sales ;
FROM opmrp,sld ;
WHERE opmrp.entno = sld.itementno ;
AND VAL(opmrp.batch) = VAL(sld.batch) ;
AND opmrp.date = sld.batchdate ;
AND opmrp.stopdelv = .t. ;
GROUP BY 1,2,3
SELECT pdd.itementno, ;
VAL(pdd.batch) as batch ,;
pdd.batchdate ,;
VAL(pdd.total) as opqty , ;
SUM(VAL(sld.qty)) as sales ;
FROM pdd,sld ;
WHERE pdd.itementno = sld.itementno ;
AND VAL(pdd.batch) = VAL(sld.batch) ;
AND pdd.batchdate = sld.batchdate ;
AND pdd.stopdelv=.t. GROUP BY 1,2,3
Regards
Rajesh
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only