SELECT ML.CODE [KODU], ML.NAME [AÇIKLAMA], SUM(CASE ST.TRCODE WHEN 14 THEN ST.AMOUNT ELSE 0 END)[DEVİR MİKTAR], SUM(CASE ST.TRCODE WHEN 14 THEN ST.TOTAL ELSE 0 END)[DEVİR TUTARI], SUM(CASE ST.TRCODE WHEN 1 THEN ST.AMOUNT ELSE 0 END)[ALIM MİKTARI], SUM(CASE ST.TRCODE WHEN 1 THEN ST.TOTAL ELSE 0 END)[ALIM TUTARI], SUM(CASE ST.TRCODE WHEN 3 THEN ST.AMOUNT ELSE 0 END)[SAT.İADE MİKTARI], SUM(CASE ST.TRCODE WHEN 3 THEN ST.TOTAL ELSE 0 END)[SAT.İADE TUTARI], SUM(CASE ST.TRCODE WHEN 50 THEN ST.AMOUNT ELSE 0 END)[SAYIM FAZLASI MİKTARI], SUM(CASE ST.TRCODE WHEN 50 THEN ST.TOTAL ELSE 0 END)[SAYIM FAZLASI TUTARI], SUM(CASE ST.TRCODE WHEN 14 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 1 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 50 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 3 THEN ST.AMOUNT ELSE 0 END) [GİRİŞLER MİKTARI], SUM(CASE ST.TRCODE WHEN 14 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 1 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 50 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 3 THEN ST.TOTAL ELSE 0 END) [GİRİŞLER TOPLAMI], SUM(CASE ST.TRCODE WHEN 8 THEN ST.AMOUNT ELSE 0 END)[SATIŞ MİKTARI], SUM(CASE ST.TRCODE WHEN 8 THEN ST.TOTAL ELSE 0 END)[SATIŞ TUTARI], SUM(CASE ST.TRCODE WHEN 12 THEN ST.AMOUNT ELSE 0 END)[SARF MİKTARI], SUM(CASE ST.TRCODE WHEN 12 THEN ST.TOTAL ELSE 0 END)[SARF TUTARI], SUM(CASE ST.TRCODE WHEN 6 THEN ST.AMOUNT ELSE 0 END)[ALIŞ İADE MİKTARI], SUM(CASE ST.TRCODE WHEN 6 THEN ST.TOTAL ELSE 0 END)[ALIŞ İADE TUTARI], SUM(CASE ST.TRCODE WHEN 51 THEN ST.AMOUNT ELSE 0 END)[SAYIM EKSİĞİ MİKTARI], SUM(CASE ST.TRCODE WHEN 51 THEN ST.TOTAL ELSE 0 END)[SAYIM EKSİĞİ TUTARI], SUM(CASE ST.TRCODE WHEN 8 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 12 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 6 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 51 THEN ST.AMOUNT ELSE 0 END) [ÇIKIŞLAR MİKTARI], SUM(CASE ST.TRCODE WHEN 8 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 12 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 6 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 51 THEN ST.TOTAL ELSE 0 END) [ÇIKIŞLAR TOPLAMI], SUM(CASE ST.TRCODE WHEN 25 THEN ST.AMOUNT ELSE 0 END)[AMBAR MİKTARI], SUM(CASE ST.TRCODE WHEN 25 THEN ST.TOTAL ELSE 0 END)[AMBAR TUTARI], (SUM(CASE ST.TRCODE WHEN 14 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 1 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 50 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 3 THEN ST.AMOUNT ELSE 0 END))- (SUM(CASE ST.TRCODE WHEN 8 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 12 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 6 THEN ST.AMOUNT ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 51 THEN ST.AMOUNT ELSE 0 END)) [KALAN MİKTAR], (SUM(CASE ST.TRCODE WHEN 14 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 1 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 50 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 3 THEN ST.TOTAL ELSE 0 END))- (SUM(CASE ST.TRCODE WHEN 8 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 12 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 6 THEN ST.TOTAL ELSE 0 END)+ SUM(CASE ST.TRCODE WHEN 51 THEN ST.TOTAL ELSE 0 END)) [KALAN TOPLAM] FROM LG_008_05_STLINE ST, LG_008_ITEMS ML WHERE ST.STOCKREF=ML.LOGICALREF AND MONTH(ST.DATE_)<6 GROUP BY ML.CODE, ML.NAME
hocam buna depo konu nasıl ekleyeceğiz
INVENNO=0 BUNU NEREYE EKLEYECEĞİM SÜREKLİ SORUN VERİYOR yardımcı olurmusun