locked
FetchXML query problem RRS feed

  • Question

  • hi,

    i have this query :

    <fetch distinct="false" mapping="logical" aggregate="true" output-format="xml-platform" >
        <entity name="opportunity" >
            <attribute name="actualvalue" alias="opportunity_sum" aggregate="sum" />
            <attribute name="createdbyname" alias="Commercial" groupby="true" />
            <filter type="and" >
                <condition attribute="actualclosedate" operator="eq" dategrouping="quarter" value="1" />
            </filter>
        </entity>
    </fetch>

    i need to specify the value of quarter, in this example i need the quarter 1...

    any idea (query not work).


    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

    Monday, April 6, 2015 11:12 AM

Answers

  • Hello,

    Seems that mentioned syntax is not appropriate for FetchXml. Please recheck following article that describes appropriate DateTime operators that could be used in FetchXml - https://msdn.microsoft.com/en-us/library/gg334216.aspx

    It seems that you've tried to combine Aggregation and Filters that would not work. In case you want to add a filtration by quarter you will have to do it in plugin (in case you will use your FetchXml expression in plugin) or in the report if you will use it there.


    Dynamics CRM MVP
    My blog


    Monday, April 6, 2015 11:20 AM
    Moderator

All replies

  • Hello,

    Seems that mentioned syntax is not appropriate for FetchXml. Please recheck following article that describes appropriate DateTime operators that could be used in FetchXml - https://msdn.microsoft.com/en-us/library/gg334216.aspx

    It seems that you've tried to combine Aggregation and Filters that would not work. In case you want to add a filtration by quarter you will have to do it in plugin (in case you will use your FetchXml expression in plugin) or in the report if you will use it there.


    Dynamics CRM MVP
    My blog


    Monday, April 6, 2015 11:20 AM
    Moderator
  • Hello,

    Seems that mentioned syntax is not appropriate for FetchXml. Please recheck following article that describes appropriate DateTime operators that could be used in FetchXml - https://msdn.microsoft.com/en-us/library/gg334216.aspx

    It seems that you've tried to combine Aggregation and Filters that would not work. In case you want to add a filtration by quarter you will have to do it in plugin (in case you will use your FetchXml expression in plugin) or in the report if you will use it there.


    Dynamics CRM MVP
    My blog


    thanks Andrii

    Mark as answer or vote as helpful if you find it useful | Ammar Zaied [MCP]

    Monday, April 6, 2015 12:41 PM