Multiple zips in extractions

could anyone provide how to edit codes to include multiple zip codes in a list manager (that also can be used in extractions?) And should I use = or Like?

 

Parents
  • Let me try. And I just came up with this (and it works, not a smart way to write SQL, however):

     

    Select Distinct a.customer_no

     From V_CUSTOMER_WITH_PRIMARY_GROUP a  WITH (NOLOCK)

    JOIN (Select a1.customer_no From vs_address a1 WITH (NOLOCK) Where a1.postal_code = '94027') as e ON e.customer_no = a.expanded_customer_no

    Where  IsNull(a.inactive, 1) = 1

    UNION

    Select Distinct a.customer_no

     From V_CUSTOMER_WITH_PRIMARY_GROUP a  WITH (NOLOCK)

    JOIN (Select a1.customer_no From vs_address a1 WITH (NOLOCK) Where a1.postal_code = '11962') as e ON e.customer_no = a.customer_no

    Where  IsNull(a.inactive, 1) = 1

    UNION

    Select Distinct a.customer_no

     From V_CUSTOMER_WITH_PRIMARY_GROUP a  WITH (NOLOCK)

    JOIN (Select a1.customer_no From vs_address a1 WITH (NOLOCK) Where a1.postal_code = '10013') as e ON e.customer_no = a.customer_no

    Where  IsNull(a.inactive, 1) = 1

    UNION

    Select Distinct a.customer_no

     From V_CUSTOMER_WITH_PRIMARY_GROUP a  WITH (NOLOCK)

    JOIN (Select a1.customer_no From vs_address a1 WITH (NOLOCK) Where a1.postal_code = '10065') as e ON e.customer_no = a.customer_no

    Where  IsNull(a.inactive, 1) = 1

    UNION

    Select Distinct a.customer_no

     From V_CUSTOMER_WITH_PRIMARY_GROUP a  WITH (NOLOCK)

    JOIN (Select a1.customer_no From vs_address a1 WITH (NOLOCK) Where a1.postal_code = '10075') as e ON e.customer_no = a.customer_no

    Where  IsNull(a.inactive, 1) = 1

     

    From: Tessitura Development Forum [mailto:forums-development@tessituranetwork.com] On Behalf Of Matthew Hoyt
    Sent: Tuesday, May 12, 2015 5:07 PM
    To: Joe Hsu
    Subject: Re: [Tessitura Development Forum] Multiple zips in extractions

     

    Hi Joe,

    Here's an example of how to get more than one zip code via a manual edit. Does this help?

    select distinct customer_no
    from dbo.VS_ADDRESS where LEFT(postal_code,5) in ('63124','63116') and primary_ind = 'Y'

    Matt

    From: Joe Hsu <bounce-joehsu1335@tessituranetwork.com>
    Sent: 5/12/2015 4:40:31 PM

    could anyone provide how to edit codes to include multiple zip codes in a list manager (that also can be used in extractions?) And should I use = or Like?

     




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Development Forum. You may reply to this message to post to the Development 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
  • Let me try. And I just came up with this (and it works, not a smart way to write SQL, however):

     

    Select Distinct a.customer_no

     From V_CUSTOMER_WITH_PRIMARY_GROUP a  WITH (NOLOCK)

    JOIN (Select a1.customer_no From vs_address a1 WITH (NOLOCK) Where a1.postal_code = '94027') as e ON e.customer_no = a.expanded_customer_no

    Where  IsNull(a.inactive, 1) = 1

    UNION

    Select Distinct a.customer_no

     From V_CUSTOMER_WITH_PRIMARY_GROUP a  WITH (NOLOCK)

    JOIN (Select a1.customer_no From vs_address a1 WITH (NOLOCK) Where a1.postal_code = '11962') as e ON e.customer_no = a.customer_no

    Where  IsNull(a.inactive, 1) = 1

    UNION

    Select Distinct a.customer_no

     From V_CUSTOMER_WITH_PRIMARY_GROUP a  WITH (NOLOCK)

    JOIN (Select a1.customer_no From vs_address a1 WITH (NOLOCK) Where a1.postal_code = '10013') as e ON e.customer_no = a.customer_no

    Where  IsNull(a.inactive, 1) = 1

    UNION

    Select Distinct a.customer_no

     From V_CUSTOMER_WITH_PRIMARY_GROUP a  WITH (NOLOCK)

    JOIN (Select a1.customer_no From vs_address a1 WITH (NOLOCK) Where a1.postal_code = '10065') as e ON e.customer_no = a.customer_no

    Where  IsNull(a.inactive, 1) = 1

    UNION

    Select Distinct a.customer_no

     From V_CUSTOMER_WITH_PRIMARY_GROUP a  WITH (NOLOCK)

    JOIN (Select a1.customer_no From vs_address a1 WITH (NOLOCK) Where a1.postal_code = '10075') as e ON e.customer_no = a.customer_no

    Where  IsNull(a.inactive, 1) = 1

     

    From: Tessitura Development Forum [mailto:forums-development@tessituranetwork.com] On Behalf Of Matthew Hoyt
    Sent: Tuesday, May 12, 2015 5:07 PM
    To: Joe Hsu
    Subject: Re: [Tessitura Development Forum] Multiple zips in extractions

     

    Hi Joe,

    Here's an example of how to get more than one zip code via a manual edit. Does this help?

    select distinct customer_no
    from dbo.VS_ADDRESS where LEFT(postal_code,5) in ('63124','63116') and primary_ind = 'Y'

    Matt

    From: Joe Hsu <bounce-joehsu1335@tessituranetwork.com>
    Sent: 5/12/2015 4:40:31 PM

    could anyone provide how to edit codes to include multiple zip codes in a list manager (that also can be used in extractions?) And should I use = or Like?

     




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Development Forum. You may reply to this message to post to the Development 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