Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with SQL including a SUM....
Message
From
17/08/2000 18:11:51
 
 
To
17/08/2000 15:49:34
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00406341
Message ID:
00406446
Views:
34
The syntax you use for your left join is incorrect. You can use

select ...;
from apdetl;
left join appay on apdetl.apdetlid=appay.apdetlid ;
where apdetl.apmasid=apmas.apmasid

Or

select ...;
from apdetl;
where apdetl.apmasid=apmas.apmasid and apdetl.apdetlid=appay.apdetlid

HTH
>select apdetl.ivcdate, apdetl.ivcnum, apdetl.duedate, apdetl.amount, sum(appay.amount), apdetl.amount-sum(appay.amount) ;
>from apdetl left join appay ;
>where apdetl.apmasid=apmas.apmasid and apdetl.apdetlid=appay.apdetlid ;
>into cursor curLstApDetl ;
>order by apdetl.ivcdate
Previous
Reply
Map
View

Click here to load this message in the networking platform