Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Join on Where?
Message
De
10/02/2000 16:15:41
 
 
À
10/02/2000 16:04:29
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00330328
Message ID:
00330334
Vues:
20
Michael,

The joins have to specify what they join:

>sele dl.date, dl.ofc;
__left(sh.repid,2) as mgr, sh.repid as repid, sh.project as project,;
__sh.pub as pub, CNT(sh.rescode) as Sales,;
__sum(th.hours) as Hours,sum(th.salecalls + th.refcalls) as Contacts,;
__cnt(cx.cxlby) as Cancels,;
FROM dailylog dl left join salehist sh ON dl.date,;
__salehist sh Left Join timehist th ON sh.repid,;
__salehist sh Left Join cancels cx ON sh.repid;
GROUP BY sh.repid, sh.project ;
INTO cursor qcDivStaRep

Should be more like

SELECT dl.date, dl.ofc;
__left(sh.repid,2) as mgr, sh.repid as repid, sh.project as project,;
__sh.pub as pub, CNT(sh.rescode) as Sales,;
__sum(th.hours) as Hours,sum(th.salecalls + th.refcalls) as Contacts,;
__cnt(cx.cxlby) as Cancels,;
FROM dailylog dl LEFT JOIN salehist sh ON dl.date = sh.date ;
LEFT JOIN timehist th ON sh.repid = th.repid ;
etc,

The general syntax is something like
FROM table1 LEFT JOIN table2 ON table1.field1 = table2.field 2
LEFT JOIN table3 ON table2.field2 = table3.field2

There are other ways too, but this should get you started. Check out the SELECT - SQL help item in VFP6

HTH,
Bill
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform