Print Page | Close Window

Distinct values from a table

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1418
Printed Date: 02 May 2024 at 7:11pm


Topic: Distinct values from a table
Posted By: jerryleguer
Subject: Distinct values from a table
Date Posted: 01 Oct 2007 at 11:50am
Table
 
ID  IDQUOTE   STATE    DATE
1          55           4        1/15/2006
2          55           5        2/15/2006
3          55           6        3/15/2006
4          56           5        12/15/2007
5          57           5         12/15/2007
 
 
I WANT TO PRESENT IN THE REPORT IDQUOTE AND DATE ONLY WHERE THE STATE IS 5.
 
I CREATED A FORMULA FOR THE DATE COLUMN THAT IS NAMED @DATE5 AND THE FORMULA IS: IF STATE = 5 THEN DATE.
 
WHAT IS PRESENTED IN THE REPORT IS
 
IDQUOTE       DATE
55                 
55
55                 3/15/2006
56                12/15/2007
57                12/15/2007
 
THIS IS WHAT IS PRESENTED IN THE REPORT. I DONT WANT THE TWO ROWS WITH THE 55 IDQUOTE TO APPEAR. HOW CAN I DO THAT?



Replies:
Posted By: BrianBischof
Date Posted: 01 Oct 2007 at 11:57am
The problem is that you are still allowing the non "5" states into the report and just setting their dates to null. Rather than using a formula for displaying the date field, use a record selection formula so that the non "5" states don't even get selected.

-------------
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