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

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

问题描述

使用水晶报表 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

等等……,

personid 的日期应该只出现一次.但是我从数据库中得到了重复的记录.日期一次又一次地显示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 再按 Date 分组,将字段从 details 部分移动到 Date 组页脚,然后取消 Details,PersonID Header和页脚和日期页眉,以便日期页脚用作您的详细信息行.这样做只会为每个 PersonID 和 Date 组合显示一行.希望对您有所帮助.

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

因此,如果您隐藏除 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天全站免登陆