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

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

SQl query to Fetch XML query

(0) ShareShare
ReportReport
Posted on by
Hi,

I want to convert SQL query to Datavese fetch xml query.


Select top 100 discussion, createdon, mostrecentdate

from mspwrplt_cmty_discussionthread

where record='548sc5e'

ORDER BY 

CASE 

    WHEN createdon < mostrecentdateTHEN mostrecentdate

    ELSE  createdon

END DESC;

 
 
Categories:
I have the same question (0)
  • Verified answer
    MichaelFP Profile Picture
    1,845 Super User 2025 Season 2 on at
    SQl query to Fetch XML query
    to convert
  • Verified answer
    ankit_singhal Profile Picture
    584 Super User 2025 Season 2 on at
    SQl query to Fetch XML query
    You can use CRM tool box or its simple you can go in advance find and select you entity and applied same filter there and download fetch xml file 
  • Verified answer
    Shashank Bhide Profile Picture
    942 Moderator on at
    SQl query to Fetch XML query
    FetchXML doesn't have built in CASE....WHEN...THEN, otherwise you can use the tools suggested by other community members in the post.
  • Mohit ENG Profile Picture
    on at
    SQl query to Fetch XML query
    Thanks for the response .
  • Jatinkumar Profile Picture
    on at
    SQl query to Fetch XML query
    Hi @Mohit
  • Jatinkumar Profile Picture
    on at
    SQl query to Fetch XML query
  • Jatinkumar Profile Picture
    on at
    SQl query to Fetch XML query
    Smoke test

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 671 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 424 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard

Featured topics