Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting ALL email addresses

Status
Not open for further replies.

ProCorr

Technical User
Sep 29, 2011
1
US
Is there a means to extract ALL of the emails from the database? When I export emails currently, the results are only for the primary contact within each record, and I would like to export the email addresses for all contacts in all records
 
Give this a shot:

select AccountNo,
Company,
Contact,
Address1,
Address2,
City,
State,
Zip,
Phone1,
(select top 1 contsupref+address1
from contsupp as cs
where cs.accountno = c1.accountno
and contact = 'E-MAIL ADDRESS'
and zip like '_1__'
) as Email
from contact1 as c1
Union select ContSupp.AccountNo,
ContSupp.Contact as Company,
ContSupp.Contact,
ContSupp.Address1,
ContSupp.Address2,
ContSupp.City,
ContSupp.State,
ContSupp.Zip,
ContSupp.Phone,
CS2.ContSupRef+CS2.Address1 AS Email
FROM Contact1, ContSupp, ContSupp CS2
WHERE Contact1.AccountNo=ContSupp.Accountno
and ContSupp.RecID = CS2.LinkAcct
AND ContSupp.RecType='C'
order by Company

DJ Hunt
Phone: (978)2-3333
WebSite:
- The Hacker's Guide to GoldMine Premium
- One-on-One GoldMine Technical Support ( Fee Based )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top