/
Sql report

Sql report

SELECT

--0.5% amount

datepart(YEAR,a.transaction_time) Year, datepart(MONTH,a.transaction_time) Month, count(1) Volume,

sum((CAST( transaction_amount as money)/100) ) 'Total Value',sum((CAST( transaction_amount as money)/100) * 0.005 ) Charge

 

FROM [dcir_db].[dbo].[backoffice_transaction_records] a

where

--a.transaction_time>= '2023-09-01 00:00:00.000' and a.transaction_time <= '2023-10-01 00:00:00.000'

response_code in ('00')

and card_acceptor_id in (select card_acceptor_id from merchants

where concession_charge_type_id = '11') and (CAST( transaction_amount as money)/100) <200000

group by datepart(YEAR,a.transaction_time), datepart(MONTH,a.transaction_time)

order by year, month

 

 

 

SELECT

--0.5% amount

datepart(YEAR,a.transaction_time) Year, datepart(MONTH,a.transaction_time) Month, count(1) Volume,

sum((CAST( transaction_amount as money)/100) ) 'Total Value',( count(1) * 1000 ) Charge

 

FROM [dcir_db].[dbo].[backoffice_transaction_records] a

where

--a.transaction_time>= '2023-09-01 00:00:00.000' and a.transaction_time <= '2023-10-01 00:00:00.000'

response_code in ('00')

and card_acceptor_id in (select card_acceptor_id from merchants

where concession_charge_type_id = '11') and (CAST( transaction_amount as money)/100) >200000

group by datepart(YEAR,a.transaction_time), datepart(MONTH,a.transaction_time)

order by year, month

Related content

MetaBase
Read with this
Important Queries
Important Queries
More like this
New Joiner - Onboarding
New Joiner - Onboarding
Read with this
TeamApt Integrity OPS
TeamApt Integrity OPS
Read with this
Work Schedule - AptPay Ops
Work Schedule - AptPay Ops
Read with this