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)selecta.customer_no, b.description, a.n1n2_ind,from tx_const_cust a (nolock)join tr_constituency b (nolock) on a.constituency=b.idwhere a.constituency = @const
WHERE (end_dt is null or end_dt>getdate())and a.constituency=@const
should do.
Or you could use vx_const_cust_active instead of tx_const_cust.
Thanks Amanda.....before I got this from you, I just finally figured it out!! I really appreciate the help!!
Teresa