Help for this page
select -- Key fields D.Merchant_ID, 'YYYYMM' as Billing_Period, D.TxnType, ... ... from TxnDtls D where D.TxnDate between ... and ... group by D.Merchant_ID, D.TxnType, ...