MikeCopeland
Programmer
Using CR 8.5...
I have a problem with SQL access of multiple tables that's producing incorrect CR results.
Here is how the data looks:
//////////////////////////////////////////////////////
Table1
ID: 212283
Table2
ClientKey: 212283 Enroll: 2/2/2007 Close: 5/1/2007
ClientKey: 212283 Enroll: 6/2/2006 Close: 2/1/2007
ClientKey: 212283 Enroll: 4/7/2005 Close: 3/31/2006
//////////////////////////////////////////////////////
I am linking the ID to the ClientKey...
Of the 3 records in Table2 I wish to process ONLY the 1st 2, and I need to link to subsequent tables via them. I am using a formula to qualify the record selection:
//---------------------------------------------------
{ClientEnrollment.Enroll} <= {?EndDate}
AND ({@Discharge} >= {?StartDate} AND
{@Discharge} <= {?EndDate})
AND {Clients.ClientLastName} <> "TEST"
//---------------------------------------------------
And the Discharge formula is:
//---------------------------------------------------
// @Discharge
WhileReadingRecords;
if IsNull({ClientEnrollment.Close})
then {?EndDate}
else {ClientEnrollment.Close}
//---------------------------------------------------
The problem is that, although my report shows 2 RECORDS (as it should), the data in them is DUPLICATED: it's the data from the FIRST record in Table2. How do I correct this? TIA
I have a problem with SQL access of multiple tables that's producing incorrect CR results.
Here is how the data looks:
//////////////////////////////////////////////////////
Table1
ID: 212283
Table2
ClientKey: 212283 Enroll: 2/2/2007 Close: 5/1/2007
ClientKey: 212283 Enroll: 6/2/2006 Close: 2/1/2007
ClientKey: 212283 Enroll: 4/7/2005 Close: 3/31/2006
//////////////////////////////////////////////////////
I am linking the ID to the ClientKey...
Of the 3 records in Table2 I wish to process ONLY the 1st 2, and I need to link to subsequent tables via them. I am using a formula to qualify the record selection:
//---------------------------------------------------
{ClientEnrollment.Enroll} <= {?EndDate}
AND ({@Discharge} >= {?StartDate} AND
{@Discharge} <= {?EndDate})
AND {Clients.ClientLastName} <> "TEST"
//---------------------------------------------------
And the Discharge formula is:
//---------------------------------------------------
// @Discharge
WhileReadingRecords;
if IsNull({ClientEnrollment.Close})
then {?EndDate}
else {ClientEnrollment.Close}
//---------------------------------------------------
The problem is that, although my report shows 2 RECORDS (as it should), the data in them is DUPLICATED: it's the data from the FIRST record in Table2. How do I correct this? TIA