web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

fetchXML i think its miles away from sql possiblities - Whats the fxml-alternative for Case When,

(0) ShareShare
ReportReport
Posted on by

how to do this with fetchXML??

I mean the CASE WHEN THEN ...

SELECT DISTINCT 

contactid, 
fullname, 
birthdate, 
address1_line1,
address1_postalcode,
CASE WHEN contactid IN @family THEN 'true' ELSE 'false' END AS family, 
CASE WHEN contactid IN @same_address THEN 'true' ELSE 'false' END AS same_address, 
CASE WHEN contactid IN @kundeid THEN 'true' ELSE 'false' END AS contact_started_from

FROM         
FilteredContact

WHERE     
(contactid IN (@choose_contacts_to_show))

ORDER BY 
fullname


*This post is locked for comments

I have the same question (0)
  • RajatSharmaRaj Profile Picture
    on at

    Are you working on SSRS here? If so then you will have to add report level conditions like below -

    social.msdn.microsoft.com/.../ssrs-case-statement

    You can find more details about decision function for SSRS here -

    docs.microsoft.com/.../expression-examples-report-builder-and-ssrs

  • Peter Bohn Profile Picture
    on at

    Hi Rajat,

    No I need to get this working in crm online, cause we moved to crm online and there is only fetchXML allowed. But how can I get this transformed from sql to fetchXML?

  • Arun Vinoth Profile Picture
    11,615 Moderator on at

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans