Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8153667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:05:48+00:00 2026-06-06T16:05:48+00:00

How do I build a CRM SDK QueryExpression where the values of two columns

  • 0

How do I build a CRM SDK QueryExpression where the values of two columns are combined to a new one? In MySQL, my query would look like that:

SELECT *, (`latest_maintenance`+`maintenance_interval`) as `next_maintenance` FROM `servers` ORDER BY `next_maintenance` DESC

In C#, however, I have only managed to do the following:

var retrieveRequest = new RetrieveMultipleRequest();

retrieveRequest.Query = new QueryExpression
                                    {
                                        EntityName = "server",
                                        ColumnSet = new ColumnSet(new[] {"latest_maintenance", "maintenance_interval"})
                                    };

var crmReponse = (RetrieveMultipleResponse) service.Execute(retrieveRequest);

How would I join “latest_maintenance” and “maintenance_interval” to “next_maintenace” in order to be able to use an OrderExpression?

EDIT: How would I make a simple string-based query for Microsoft Dynamics CRM? Seems like a way easier and more intelligible way than their default one.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:05:50+00:00Added an answer on June 6, 2026 at 4:05 pm

    If you are using the SDK for server-side code, then your choice is QueryExpression or FetchXml. Neither will do what you are asking, natively.

    Remember that with QueryExpression you are returning typed objects, not just strings so if you are to concatenate two values, they need a container in which to be stored, i.e. an attribute.

    Can you not just “order by” column1 then column2? I.e.

    var myQueryExpression = new QueryExpression
                                    {
                                        EntityName = "server",
                                        ColumnSet = new ColumnSet(new[]{
                                            "latest_maintenance", 
                                            "maintenance_interval"})
                                    };
    myQueryExpression.AddOrder("latest_maintenance", OrderType.Ascending);
    myQueryExpression.AddOrder("maintenance_interval", OrderType.Ascending);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a Dynamics CRM 4 query so that I can get
I would like to write a plug-in that will allow a custom written CRM
I am currently using silverlight to build a control for a CRM form. There
We got a company to help us build a CRM of sorts in Cakephp
In Microsoft Dynamics CRM 2011, I wrote one plug-in in C# for Account entity
I am querying data from CRM 2011 using FetchXML to build a report in
I have a customer relations system which I have built, what I would like
I'm trying to build some CRM tools that send emails to my sales guys
I would like to develop a web application in Java/Spring/Hibernate serving as a business
I've put an html web resource on my contract form and would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.