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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

whileprintingrecords returns dups

Status
Not open for further replies.

dnamm

Programmer
Jul 16, 2003
8
0
0
US
Hi,

I'm using CR 8.0, database sql server 2000. I'm trying to concatinate all the FromDateSVC of a claim and display it at the group footer (group on ClaimNo).
These are my calculated fields
ResetDate:
whileprintingrecords;
StringVar FromDate := "";

GetDate:
whileprintingrecords;
stringvar FromDate ;
if (FromDate = "") then
FromDate := totext({RV_CLAIM_DETAILS.FROMDATESVC})
else
FromDate := FromDate + '; ' + totext({RV_CLAIM_DETAILS.FROMDATESVC})

DisplayDate:
whileprintingrecords;
stringvar FromDate;

I placed the ResetDate at the group header, the GetDate at the details level and the DisplayDate at the group footer.

My report is running base on a claimNo parameter, which means only one claim number input to run at the time. The DisplayDate field returns dups.
Example: ClaimNo 20041028034 have only 1 FromDateSVC (06/30/2004)
the formula returns 06/30/2004;06/30/2004

Thank you so much for all of your help!

dnamm
 
One means would be a minor change:

GetDate:
whileprintingrecords;
stringvar FromDate ;
if instr(FromDate,{RV_CLAIM_DETAILS.FROMDATESVC}) = 0 then
FromDate := FromDate + '; ' + totext({RV_CLAIM_DETAILS.FROMDATESVC})

DisplayDate:
whileprintingrecords;
stringvar left(FromDate,len(FromDate)-1);
 
Hi,

Thank you very much!

For the DisplayDate, it should be right instead of left.
Using left function, it still display the ";" and chop off the last number in the last date. (ex: ;06/30/200 )

DisplayDate:
whileprintingrecords;
stringvar right(FromDate,len(FromDate)-1);

dnamm
 
It should be:

//{@DisplayDate}:
whileprintingrecords;
stringvar FromDate;
left(FromDate,len(FromDate)-2);

-LB
 
Sorry, I hadn't looked at your formula close enough, change to:

GetDate:
whileprintingrecords;
stringvar FromDate ;
if instr(FromDate,{RV_CLAIM_DETAILS.FROMDATESVC}) = 0 then
FromDate := FromDate + totext({RV_CLAIM_DETAILS.FROMDATESVC})+";"

I hadn't considered that you might have been doing it differently...

Your RIGHT function will omit the last value.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top