SQL Help

Everyone,

I'm trying to make what I believe should be a very easy modification to a report and I'm having trouble getting it to work.  All I want to do is make the report return accounts with constituencies  that are still active.  The caveat is that for active constituencies, there are no end dates.  In the tx_const_cust table, the end_dt is NULL.  I can't figure out how to edit the code properly to make the report work (and I know it's something pretty easy for someone who knows what they are doing)  Unfortunately, I'm not one of those people!!  Is anyone out there willing to help me out???  :o)

My code I know I need to edit is:

 

 

 

 

insert

 

into #contact (customer_no, const, n1_n2_ind)
select
a.customer_no, b.description, a.n1n2_ind,
from
tx_const_cust a (nolock)
join
tr_constituency b (nolock) on a.constituency=b.id
where a.constituency = @const

Parents
  • Hi Teresa – replace the tx_const_cust reference in your query with the view vx_const_cust_active.  This is a standard view that returns only active constituencies (including those with no end dates).

     

    -Matt

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Teresa Dean
    Sent: Wednesday, June 23, 2010 12:55 PM
    To: Matt Cooper
    Subject: [Tessitura Technical Forum] SQL Help

     

    Everyone,

    I'm trying to make what I believe should be a very easy modification to a report and I'm having trouble getting it to work.  All I want to do is make the report return accounts with constituencies  that are still active.  The caveat is that for active constituencies, there are no end dates.  In the tx_const_cust table, the end_dt is NULL.  I can't figure out how to edit the code properly to make the report work (and I know it's something pretty easy for someone who knows what they are doing)  Unfortunately, I'm not one of those people!!  Is anyone out there willing to help me out???  :o)

    My code I know I need to edit is:

     

     

     

     

    insert

     

    into #contact (customer_no, const, n1_n2_ind)
    select
    a.customer_no, b.description, a.n1n2_ind,
    from
    tx_const_cust a (nolock)
    join
    tr_constituency b (nolock) on a.constituency=b.id
    where a.constituency = @const




    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 Teresa – replace the tx_const_cust reference in your query with the view vx_const_cust_active.  This is a standard view that returns only active constituencies (including those with no end dates).

     

    -Matt

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Teresa Dean
    Sent: Wednesday, June 23, 2010 12:55 PM
    To: Matt Cooper
    Subject: [Tessitura Technical Forum] SQL Help

     

    Everyone,

    I'm trying to make what I believe should be a very easy modification to a report and I'm having trouble getting it to work.  All I want to do is make the report return accounts with constituencies  that are still active.  The caveat is that for active constituencies, there are no end dates.  In the tx_const_cust table, the end_dt is NULL.  I can't figure out how to edit the code properly to make the report work (and I know it's something pretty easy for someone who knows what they are doing)  Unfortunately, I'm not one of those people!!  Is anyone out there willing to help me out???  :o)

    My code I know I need to edit is:

     

     

     

     

    insert

     

    into #contact (customer_no, const, n1_n2_ind)
    select
    a.customer_no, b.description, a.n1n2_ind,
    from
    tx_const_cust a (nolock)
    join
    tr_constituency b (nolock) on a.constituency=b.id
    where a.constituency = @const




    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