Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capturing a first time occurance in crystal

Status
Not open for further replies.

sap1958

Technical User
Oct 22, 2009
138
US
I have a financial report that uses a date parameter to capture a date range (ie 7/1/2006 through 6/30/2007). Since I am already limiting my search based on the date ranges, is there a way that I can capture a transaction and put an indicator for a transaction that occured prior to my selected date range. Here is a sample output. Let us say I am using a gits_table

FirstDonation Amt Date ID
Y 300 7/1/2006 1
N 200 7/16/2006 2

In this example, I want to put a Y in the FirstDonation field because ID#1 never gave before. As for ID#2, they gave before so we insert an N.

1.Will I need to use a subreport or soething similar. I ask because I have already supressed any transactions prior to the beginning date.
2. Is it best to use two date parameters or one


 
You could allow all records in and use the parameter range to suppress all earlier records instead of using it in the selection formula.

Or you could create a SQL expression {%mindate} like this:

(
select min(`date`)
from table A
where A.`ID` = table.`ID`
)

Then you could create a formula like this:

if {table.date} = {%mindate} then
"Y" else
"N"

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top