Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

innner join left outer join in fetchcml

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

Can anyone help in converting this to fetchxml?

select DATEPART(year, op.CreatedOn) AS [Year], DATEPART(month, op.CreatedOn) AS [Month], p2.ProductNumber, SUM(op.ExtendedAmount) AS [Amount]
from dbo.OpportunityProduct op
     inner join dbo.Product p1 on (op.ProductId = p1.ProductId)
     left outer join dbo.Product P2 on (p1.ParentProductId = p2.ProductId)
group by DATEPART(year, op.CreatedOn), DATEPART(month, op.CreatedOn), p2.ProductNumber

http://www.sql2fetchxml.com/ says: Secondary conditions of a JOIN clause must follow the first ON condition using an AND operator.

If I

....

inner join dbo.Product p1 on (op.ProductId = p1.ProductId) AND
left outer join dbo.Product P2 on (p1.ParentProductId = p2.ProductId)

.....

I get: Error occurred when parsing the SQL script: Unsupported statement type: outer

Any ideas would be most appreciated.

Regards, Steve

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans