Summing payments by campaign and payment method

I'm trying to sum payment dollars by campaign and payment method, but my figures are enough off of those listed in Season Overview that I'm concerned that I'm counting some payments twice.

My query is simple and looks like this:

select
	t.campaign_no,
	p.pmt_method,
	SUM(p.pmt_amt) as pmt_sum
from
	T_PAYMENT as p
	inner join T_TRANSACTION as t on t.transaction_no = p.transaction_no
		and t.sequence_no = p.sequence_no
group by
	t.campaign_no,
	p.pmt_method
order by t.campaign_no, p.pmt_method

 

I'm off (higher than Season Overview) by about $1,000,000: enough that I'm not convinced that returns or gift certificates or something else like that would be responsible.  Anyone have any ideas on what I'm missing?

 

 

 



[edited by: Gawain Lavers at 12:43 PM (GMT -6) on 29 Dec 2016]
Parents
  • Hi,
    Please add one more condition
    inner join T_TRANSACTION as t1 on t.sequence_no = p.sequence_no
    in your query

    Malek

    On 12/29/2016 12:54 PM, Gawain Lavers wrote:

    I'm trying to sum payment dollars by campaign and payment method, but my figures are enough off of those listed in Season Overview that I'm concerned that I'm counting some payments twice.

    My query is simple and looks like this:

    select
     t.campaign_no,
     p.pmt_method,
     SUM(p.pmt_amt) as pmt_sum
     from
     T_PAYMENT as p
     inner join T_TRANSACTION as t on t.transaction_no = p.transaction_no

     and t.sequence_no = p.sequence_no
     group by
     t.campaign_no,
     p.pmt_method
     order by t.campaign_no, p.pmt_method
     

    I'm off (higher than Season Overview) by about $1,000,000: enough that I'm not convinced that returns or gift certificates or something else like that would be responsible.  Anyone have any ideas on what I'm missing?

     

     

     




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!

Reply
  • Hi,
    Please add one more condition
    inner join T_TRANSACTION as t1 on t.sequence_no = p.sequence_no
    in your query

    Malek

    On 12/29/2016 12:54 PM, Gawain Lavers wrote:

    I'm trying to sum payment dollars by campaign and payment method, but my figures are enough off of those listed in Season Overview that I'm concerned that I'm counting some payments twice.

    My query is simple and looks like this:

    select
     t.campaign_no,
     p.pmt_method,
     SUM(p.pmt_amt) as pmt_sum
     from
     T_PAYMENT as p
     inner join T_TRANSACTION as t on t.transaction_no = p.transaction_no

     and t.sequence_no = p.sequence_no
     group by
     t.campaign_no,
     p.pmt_method
     order by t.campaign_no, p.pmt_method
     

    I'm off (higher than Season Overview) by about $1,000,000: enough that I'm not convinced that returns or gift certificates or something else like that would be responsible.  Anyone have any ideas on what I'm missing?

     

     

     




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!

Children
No Data