SELECT dateadd(month, datediff(month, 0, H.TARIH), 0) 'Tarih',S.MUHASEBEKODU 'Grup',S.STOKADI 'StokAdý',
H.KDVORAN 'KdvOran',SUM(H.ADET) 'Adet',SUM(H.FIYAT) 'Fiyat',SUM(H.TUTAR) 'Tutar',H.DURUM 'Islem',
H.GDEPO 'GDepo',H.CDEPO 'CDepo'
FROM STOKHAREKET  H
JOIN STOK S ON S.STOKKODU=H.STOKKODU
WHERE S.CDEPO='MU' OR S.GDEPO='MU'
GROUP BY dateadd(month, datediff(month, 0, H.TARIH), 0),S.MUHASEBEKODU,S.STOKADI,H.GDEPO,H.CDEPO,H.KDVORAN,H.DURUM
ORDER BY 1 ASC,3 DESC