Quick script to calculate # of credit card transactions?

I'm trying to work out how to calculate how many credit card transactions we ran through Tessitura last year. I was assuming that it was just the count of distinct payment_nos in T_PAYMENT that had a credit card type of pmt_method.

But is there some other catch to it all that I should know about?

Parents
  • I use this...

     

    select    acct.description as [Card Type]
                  ,sum (p.pmt_amt) as [Sum]
                  ,count( distinct p.payment_no) as [Transactions]

        from      t_payment p (nolock) join
                      tr_payment_method pmt (nolock) on pmt.id = p.pmt_method join
                      tr_account_type acct (nolock) on acct.id = pmt.act_type

     

      where     p.pmt_dt between '2009-06-1 00:00:00.000' 
                      and '2013-06-1 00:00:00.000'

     

          group by acct.description
          order by acct.description

     



    [edited by: Chris Hipschen at 6:13 PM (GMT -6) on 29 Feb 2012]
  • Thanks for that, guys. The most important thing was making sure I select distinct payment_no, rather than a count, so thank you for clarifying.

Reply Children
No Data