Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SP help
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Divers
Thread ID:
01304357
Message ID:
01304404
Vues:
11
Thank you! That helps a lot.

I still need to join with CON_PHONE table to get the correct set of records so I added that back in (TYPE and DNC fields are part of that table).

Then at the end I think I just need to add a select to get the records I want returned:
SELECT DISTINCT consumer.idnum, res1_fn, res1_int, res1_ln, res1_suf, group_ID,
addr1, addr2, city, state, zip, zip4, county, res1_dob, res1_Bm, res1_by,phone
FROM consumer LEFT JOIN CON_PHONE ON consumer.idnum = CON_PHONE.IDNUM inner join @temp temp on consumer.idnum = temp.idnum
>
>NOT TESTED
>Especially look in that part:
>
>   INSERT INTO @Temp
>   SELECT consumer.idnum,
>          consumer.OLD_POOL
>   FROM consumer
>        WHERE consumer.IDNUM > 0            AND
>              consumer.ORIG_SOURCE <> 'RES' AND
>              LEADSTATUS = ' '              AND
>              TYPE NOT IN (9, 10)           AND
>              DNC=0                         AND
>              DNCFLAG = ' '                 AND
>              consumer.state = @ST          AND
>              County = @County
>
>
>To see if I get the right records
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform