我是 Fetchxml 新手,并使用 MS CRM Dynamics 2015 On Premise 通过 Visual Studio 2012 创建 SSRS 报告
我的 Fetchxml 查询返回一个日期时间列 (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>
我想与日期分组(而不是与日期时间分组)。
尝试使用进行格式化
=Format(createdonValue.value, "dd/MM/yyyy")
和
=FormatDateTime(createdonValue.value, DateFormat.ShortDate)
正在格式化,但分组不起作用。记录重复。
请告诉我是否有任何方法可以仅使用“FetchXML 结果日期值”的“日期”部分进行分组,或者在使用 fetchxml 查询时仅获取“日期”部分。(例如在另一列中。)
最佳答案
您可以将多个项目分组到一个分组中。
设置该组,使其具有三个条件
=Year(Fields!MyDateTime.Value)
还有
=Month(Fields!MyDateTime.Value)
还有
=Day(Fields!MyDateTime.Value)
您的分组详细信息将如下所示
这是将其应用于日期列的示例
请注意,尽管时间不同,但 04/04/01 这两个日期是如何分组的。
希望这是您所需要的。如果我可以提供进一步的帮助,请告诉我。
关于date - SSRS - 按日期时间字段的日期部分进行分组,由 FetchXML 查询产生,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33931574/