Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Merge four tables into 1 cursor
Message
 
À
28/12/2004 03:51:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Novell 4.x
Database:
Visual FoxPro
Divers
Thread ID:
00972379
Message ID:
00972501
Vues:
20
Because I don't know what You want to do. How to relate SiMain to SisUp?
1. All records from SiMain & only one record from SisUp that match record from SiMain
or
2. All Records from SiMain & all records from SisUp that match record from SiMain

for 1. old syntax must work well
    SELECT SiMain.*, SisUb.ICode, SisUb.qntymaj, , SisUb.qntymin, , SisUb.RateMaj, SisUb.RateMin,;
           PCode.PName, Icode.full_desc;
           FROM SiMain;
           LEFT JOIN SisUp ON SiMain.SiNo  == SisUp.SiNo; && May be You need RIGHT JOIN here?
           LEFT JOIN PCode ON SiMain.PCode == PCode.PCode;
           LEFT JOIN Icode ON SisUp.Icode  == Icode.Icode;
           WHERE BETWEEN(Simain.Invdate, mdt1, mdt2)        .AND.;
                 UPPER(Simain.Salesman) == UPPER(msalesman) .AND.;
                 Simain.PCode == mpcode;
    INTO CURSOR cTest
for 2.
    SELECT SiMain.*, SisUb.ICode, SisUb.qntymaj, , SisUb.qntymin, , SisUb.RateMaj, SisUb.RateMin,;
           PCode.PName, Icode.full_desc;
           FROM SiMain;
           RIGHT JOIN SisUp ON SiMain.SiNo == SisUp.SiNo; 
           LEFT JOIN PCode ON SiMain.PCode == PCode.PCode;
           LEFT JOIN Icode ON SisUp.Icode  == Icode.Icode;
           WHERE BETWEEN(Simain.Invdate, mdt1, mdt2)        .AND.;
                 UPPER(Simain.Salesman) == UPPER(msalesman) .AND.;
                 Simain.PCode == mpcode;
    INTO CURSOR cTest
BTW Is the Report running?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform