Community
Showing results for 
Search instead for 
Do you mean 
Reply

Advanced OLE DB Query

Copper Super Contributor
Posts: 61
Country: Australia

Advanced OLE DB Query

I am tasked with getting History and Activity information into an Excel document for a client. The samples listed the knowledgebase give me all I need from Contacts, Companies, and Groups however I cannot seem to use the same functions on Opportunities. Is this possible?


SELECT OPPORTUNITY.*, HISTORY.*
FROM HISTORY INNER JOIN
OPPORTUNITY_HISTORY ON HISTORY.HISTORYID = OPPORTUNITY_HISTORY.HISTORYID INNER JOIN
OPPORTUNITY ON OPPORTUNITY_HISTORY.CONTACTID = OPPORTUNITY.CONTACTID

 

The same in Contacts works fine.

 

SELECT CONTACT.*, HISTORY.*

FROM HISTORY INNER JOIN

CONTACT_HISTORY ON HISTORY.HISTORYID = CONTACT_HISTORY.HISTORYID INNER JOIN

CONTACT ON CONTACT_HISTORY.CONTACTID = CONTACT.CONTACTID

 

Brett Merriman
ACT! Certified Consultant
Action CRM
Copper Super Contributor
Posts: 61
Country: Australia

Re: Advanced OLE DB Query

The answer in case anyone is interested is:

 

SELECT OPPORTUNITY.*, HISTORY.*
FROM HISTORY INNER JOIN
OPPORTUNITY_HISTORY ON HISTORY.HISTORYID = OPPORTUNITY_HISTORY.HISTORYID INNER JOIN
OPPORTUNITY ON OPPORTUNITY_HISTORY.OPPORTUNITYID = OPPORTUNITY.OPPORTUNITYID

Brett Merriman
ACT! Certified Consultant
Action CRM