如何避免重复的值? [英] How to avoid the duplicate values?

查看:116
本文介绍了如何避免重复的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Crystal Report 8.5

Using Crystal Report 8.5

示例

Personid Date

3100   22-02-2009
3100   22-02-2009
3100   22-02-2009
3200   22-02-2009
3200   22-02-2009
3200   22-02-2009
3200   22-02-2009
3100   23-02-2009
3100   23-02-2009
3100   23-02-2009
3100   23-02-2009
3200   23-02-2009
3200   23-02-2009
3200   23-02-2009
3200   23-02-2009

那么...,

预期输出

Personid Date

3100 22-02-2009
3100 23-02-2009
3200 22-02-2009
3200 23-02-2009

So on ...,

So on…,

日期对于personid只应出现一次。但我从数据库中得到重复的记录。

Date should appear only once for the personid. But I am getting duplicate record from the database. Date is displaying again and again for the personid.

如何跳过重复的记录。任何人都可以帮助解决这个问题。

How to skip the duplicate record. Can any one help to solve this problem.

需要水晶报表公式帮助。

Need crystal report Formula Help.

推荐答案

您应该能够按PersonID分组,然后按日期,将字段从详细信息部分移动到日期分组页脚,然后禁止Details,PersonID页眉和页脚和日期标题,以便日期页脚工作作为您的详细信息行。这样做只会为每个PersonID和日期组合显示一行。希望有帮助。

You should be able to group by PersonID and then by Date, move the fields from the details section to the Date group footer and then suppress the Details, PersonID Header and Footer, and Date Header so that the Date Footer works as your details row. Doing this will only show one row for each PersonID and Date combination. Hope that helps.

编辑:
每个组标题和页脚仅对值的每次更改显示一次。因此,在你的例子中,如果你没有压制任何部分,你会有如下所示:

Each group header and footer only displays once for each change of the value. Therefore in your example if you didn't suppress any sections you'd have something like the following:

GH1 - 3100
  GH2 - 22-02-2009
      D - 3100   22-02-2009
      D - 3100   22-02-2009
  GF2 - 22-02-2009
  GH2 - 23-02-2009
      D - 3100   23-02-2009
      D - 3100   23-02-2009
      D - 3100   23-02-2009
      D - 3100   23-02-2009
  GF2 - 23-02-2009
GF1 - 3100
GH1 - 3200
  GH2 - 22-02-2009
      D - 3200   22-02-2009
      D - 3200   22-02-2009
      D - 3200   22-02-2009
      D - 3200   22-02-2009
  GF2 - 22-02-2009
  GH2 - 23-02-2009
      D - 3200   23-02-2009
      D - 3200   23-02-2009
      D - 3200   23-02-2009
      D - 3200   23-02-2009
  GF2 - 23-02-2009
GF1 - 3200


$ b b

因此,如果你隐藏所有的部分,除了GF2部分,你会得到:

Therfore if you hide all of the sections except for the GF2 sections you'd get:

  GF2 - 3100   22-02-2009
  GF2 - 3100   23-02-2009
  GF2 - 3200   22-02-2009
  GF2 - 3200   23-02-2009

这篇关于如何避免重复的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆