Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Join on Where?
Message
From
10/02/2000 16:15:41
 
 
To
10/02/2000 16:04:29
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00330328
Message ID:
00330334
Views:
19
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform