11-12-2012 05:31 AM
11-12-2012 05:55 AM
11-12-2012 05:56 AM
11-12-2012 06:23 AM
The easiest way is to start with the opportunity and then join the other tables.
11-12-2012 06:31 AM
2010 was the first version where Opportunities became a top level entity and that allowed for one-to-many relationships to exist between opportunities and contacts, so there technically isn't a "main" contact other than the record manager or the record creator, but I assume those aren't what you're looking for.
It's certainly possible to create a query that would show each opportunity only a single time, but the problem would be do you want to show all the contacts associated with the opportunity or whichever would come first (for example) in the list of associated contacts.
What specifically is the goal of this query? That might help others or myself give some more specific advice.
11-12-2012 06:38 AM
11-12-2012 06:57 AM
I haven't done it but you could probably just use a DISTINCT modifier on the query on the Opportunity ID.
11-12-2012 10:47 AM
The Opportunity table in the OLEDB has a Contact column. Based on some very isolated testing this appears to be the first contact alphabetically of those associated with the opportunity, there's also a column for this contacts ID so should be able to attach this contacts address to the qeury.