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 Reply Children
No Data