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
  • Here’s what I use to pull active constituencies:

     

    customer_no in (select customer_no from tx_const_cust

    where tx_const_cust.constituency = 2 --replace with your desired constituency

      and (end_dt > getdate() or isnull(end_dt,0) = 0))

     

    Lucie

     

    From: Teresa Dean [mailto:bounce-teresadean9276@tessituranetwork.com]
    Sent: Wednesday, June 23, 2010 12:55 PM
    To: Lucie Spieler
    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
  • Here’s what I use to pull active constituencies:

     

    customer_no in (select customer_no from tx_const_cust

    where tx_const_cust.constituency = 2 --replace with your desired constituency

      and (end_dt > getdate() or isnull(end_dt,0) = 0))

     

    Lucie

     

    From: Teresa Dean [mailto:bounce-teresadean9276@tessituranetwork.com]
    Sent: Wednesday, June 23, 2010 12:55 PM
    To: Lucie Spieler
    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