2

I am new to Fetchxml and using MS CRM Dynamics 2015 On Premise to create SSRS report using Visual Studio 2012

My Fetchxml query returns me a Datetime column (CreatedOn)

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="fax">
     <attribute name="createdon" />
     <attribute name="documenttype" />
    <attribute name="activityid" />
    <attribute name="statecode" /> 
    <order attribute="createdon" descending="false" />
   </entity>
</fetch>

I want to group with Date (not with datetime).

Tried to do formatting by using

=Format(createdonValue.value, "dd/MM/yyyy")  

and

=FormatDateTime(createdonValue.value, DateFormat.ShortDate)

It's formatting, but grouping doesn't work. Records repeats.

Please let me know is there any way to group by only with 'Date' part of 'FetchXML resulted date value' or is there anyway to get only 'date' part while querying with fetchxml.( e.g. in another column.)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Satty1
  • 23
  • 1
  • 5

1 Answers1

2

You can group on multiple items in a single grouping.

Set up the group so it has three conditions

=Year(Fields!MyDateTime.Value)

And

=Month(Fields!MyDateTime.Value)

And

=Day(Fields!MyDateTime.Value)

Your grouping details will then look like this

enter image description here

And this is an example of applying this to a column of dates

enter image description here

Note how the two 04/04/01 dates are grouped, despite the different times.

Hopefully this is what you require. Let me know if I can be of further assistance.

Jonnus
  • 2,988
  • 2
  • 24
  • 33
  • Your answer worked for me ! :). If there are Two more columns (say document type , Activity status) need to be grouped in the same row and require a total as last column depending on the second and third column, should i create it as a seperate group under the date group? adding under the same date group gives me wrong result. Also i require a group total as well for the Total Column. – Satty1 Nov 26 '15 at 13:23
  • I'm not clear on what you are asking there. Are you asking about how to construct a matrix? Perhaps anew question with your requirements clearly laid out might be best. – Jonnus Nov 26 '15 at 13:43