SELECT STORE.M_CODE S_GROUP_BY, 

S_DOC_DATE, S_DOC_DATE_DAY, S_DOC_DATE_MONTH, S_DOC_DATE_YEAR, Sum(S_QTY) S_QTY, Sum(S_COUNT) S_COUNT, Sum(S_GROSS_TOTAL) S_GROSS_TOTAL, Sum(S_DISC_ITEMTOTAL) S_ITEMDISC_TOTAL, Sum(S_DISC_TOTAL) S_DISC_TOTAL, Sum(S_GROSS_TOTAL-S_DISC_TOTAL-S_DISC_ITEMTOTAL) S_NET_TOTAL, Sum(S_TAX_TOTAL) S_TAX_TOTAL, Sum(S_FEE_ITEMTOTAL) S_ITEMFEE_TOTAL, Sum(S_FEE_TOTAL) S_FEE_TOTAL, Sum(S_GRAND_TOTAL) S_GRAND_TOTAL, Sum(S_ROUND_ADJ) S_ROUND_ADJ, Sum(S_TAX1) S_TAX1, Sum(S_TAX2) S_TAX2, Sum(S_TAX3) S_TAX3, Sum(S_TAX4) S_TAX4, Sum(S_GSTAMT_S) S_GSTAMT_S, Sum(S_GSTTAX_S) S_GSTTAX_S, Sum(S_GSTAMT_Z) S_GSTAMT_Z, Sum(S_GSTTAX_Z) S_GSTTAX_Z, Sum(S_GSTAMT_E) S_GSTAMT_E, Sum(S_GSTTAX_E) S_GSTTAX_E, Sum(S_GSTAMT_O) S_GSTAMT_O, Sum(S_GSTTAX_O) S_GSTTAX_O, Sum(S_GRAND_TOTAL+S_ROUND_ADJ) S_GRAND_TOTAL2, Sum(S_COST_TOTAL) S_COST_TOTAL From Stk_Pos Pos Left Join Mas_Store Store on (Store.M_Code=Pos.S_Store) Where S_DOC_DATE_YEAR=2019

aND S_DOC_DATE_MONTH=8


GROUP BY STORE.M_CODE, S_DOC_DATE, S_DOC_DATE_DAY, S_DOC_DATE_YEAR, S_DOC_DATE_MONTH

ORDER BY STORE.M_CODE, S_DOC_DATE 

