Information générale
Catégorie:
Codage, syntaxe et commandes
I updated the select to include the file names. SCSAQTY is a table that contains sku# and pricing. SCSASLD contains sold history. A sku can be in the sold file many times.
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 scsaqty.saq_sku, scsaqty.saq_stloc, sum(scsasld.sal_soldqty);
from scsaqty;
left outer join scsasld;
on scsaqty.saq_stloc == scsasld.sal_stloc and scsaqty.saq_sku == scsasld.sal_sku;
where between(scsasld.sal_solddate,dBgnDate,dEndDate);
group by scsaqty.saq_sku, scsaqty.saq_stloc
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement