Print Page | Close Window

Returning only one record

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4435
Printed Date: 04 May 2024 at 9:03am


Topic: Returning only one record
Posted By: cmdahlbe
Subject: Returning only one record
Date Posted: 02 Oct 2008 at 7:26am
I am do statistical analysis of our data, I need to return things like "how many people are 18-29 years of age.  I have written the report, but now I need to be able to select only one entry of data per individual.
 
Because of the nature of our business, the database contains multiple users, multiple times.  Even though the person might appear multiple times, they do have distinct ID numbers, so I am looking for a way to only count them and their data once, even though their ID appears in the range multiple times.
 
Is there a formula I could use to filter/sort out all but one entry per ID?



Replies:
Posted By: rptfan
Date Posted: 04 Oct 2008 at 12:00pm
I'd really have to see your report to help you with this one. It may take writing a sql command to only display the details you want, and then a formula to do the calculations.

Depending on your programming skills, you may be able to do it with formulas. Sometimes I write three formulas using a shared numbervar. You put one in the group header, one in the detail, and one in the group footer. The one on the group header initializes, or resets, the value. The on in the footer displays the value. The one in the detail sections sets, or sums, or calculates the value on some condition.

If you want me to take a look, send me a copy of the report in a private message.

Cheers

-------------
Save money deploying Crystal Reports!
http://reportviewer.biz/ - Try a Crystal Reports Viewer .
Refresh data. Export and manage reports.
Easy to use. Free to try.


Posted By: BrianBischof
Date Posted: 05 Oct 2008 at 6:18pm

Have you tried using groups and grouping on the User ID? To keep from repeating data, print the important information in the group header and suppress the Details section. This lets the user info only print a single time.

I have complete information on advanced formatting tricks in Chapter 8 of my Encyclopedia book. You can find out more about my books at http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - Amazon.com or reading the http://members.crystalreportsbook.com - Crystal Reports eBooks online.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window