Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help With Select
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00519030
Message ID:
00519084
Views:
13
Pat --

How about breaking it up into 2 queries?
select sal_sku, sal_stloc, sum(sal_soldqty) AS Sal_SQty;
from scsasld;
where between(sal_solddate,dBgnDate,dEndDate);
group by sal_sku, sal_stloc ;
INTO CURSOR scsasld2

select saq_sku, saq_stloc, Sal_SQty;
from scsaqty;
left outer join scsasld2;
on saq_stloc == sal_stloc and saq_sku == sal_sku
>I am trying to write a select that will give me one record for each sku and a total qty sold. This is what I have so far. My question is where do I put the code to limit the qty sold to a specific date range? I’ve tried adding a where clause, but then I don’t sku’s that don’t have sales history. Any ideas?
>
>select saq_sku, saq_stloc, sum(sal_soldqty);
>from scsaqty;
>left outer join scsasld;
>on saq_stloc == sal_stloc and saq_sku == sal_sku;
>where between(sal_solddate,dBgnDate,dEndDate);
>group by saq_sku, saq_stloc
>
>Thanks
>
>Pat
Previous
Reply
Map
View

Click here to load this message in the networking platform