【问题标题】:Crystal Reports Maximum for date and stringCrystal Reports 日期和字符串的最大值
【发布时间】:2018-12-11 09:34:57
【问题描述】:

我在创建报告时遇到了一些问题。

table1 是一个主表,其中包含日期和整数等信息。 table2 是 table1 的查找表,它通过 integar 链接到 table 2 ID,它给出了 table1 integar 的值。

table1 有如下数据: 2018 年 1 月 1 日 - 1 2/1/2018 - 2

table2 有数据如 1 = 活跃 2 = 不活动

因此,此报告的目标是查找最新状态。我的选择专家组为 table1.date = maximum({table1.date}, {@group}),我选择的专家记录为 table2.status = "Active"。

报告提取的是最新的“活动”状态。我需要它只拉“活动”状态,如果那是最近的状态,而不是打印“非活动”状态。

【问题讨论】:

    标签: crystal-reports report


    【解决方案1】:

    创建一个名为 {@Date_And_Status} 的公式,它结合了日期和状态:

    ToText({table1.date}, "yyyyMMdd") & {table2.status}

    在您的组选择公式中,使用:

    maximum({@Date_And_Status}, {@group}) = ToText(maximum({table1.date}, {@group}), "yyyyMMdd") & "Active"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-26
      • 2014-05-24
      • 1970-01-01
      • 1970-01-01
      • 2023-03-04
      • 1970-01-01
      相关资源
      最近更新 更多