SQL View Name:dt_cm_contact
SQL View Number:4662
Group:Dovetail
Base Table:contract
Description:Distinct contacts covered by a contract
Flags:VIEW_OPTIMIZED 
Baseline/Custom:Custom

Fields:

Field NameCommon TypeDatabase TypeGeneric Field IDArray SizeDefaultFlagsComment
contact_objidLONGint   USER_DEFINED  
contract_objidLONGint   USER_DEFINED  
e_mailCHARvarchar 80 USER_DEFINED  
fax_numberCHARvarchar 20 USER_DEFINED  
first_nameCHARvarchar 30 USER_DEFINED  
last_nameCHARvarchar 30 USER_DEFINED  
phoneCHARvarchar 45 USER_DEFINED  
site_idCHARvarchar 80 USER_DEFINED  
site_nameCHARvarchar 80 USER_DEFINED  
site_objidLONGint   USER_DEFINED  
statusLONGint   USER_DEFINED  
titleCHARvarchar 30 USER_DEFINED  

SQL:


SELECT distinct
contract.objid AS contract_objid,
contact.objid AS contact_objid, contact.first_name, contact.last_name, contact.phone, contact.fax_number,
contact.title, contact.status, contact.e_mail,
site.objid AS site_objid, site.name AS site_name, site.site_id
FROM
table_contract contract
INNER JOIN mtm_contact2_contract1 AS mtm1 ON contract.objid = mtm1.contract2contact
INNER JOIN table_contact contact ON contact.objid = mtm1.caller2contract
INNER JOIN table_contact_role contact_role ON contact.objid = contact_role.contact_role2contact
INNER JOIN table_site site ON site.objid = contact_role.contact_role2site
My Recent Objects
dt_cm_contact