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

Help with Data calculation

Status
Not open for further replies.

priyanthan

Programmer
Jul 27, 2008
70
CA
I working on a report where i have to do some date calculations.
based on the transaction date i need to calculate the payment date.
Basically it looks like the following,

Transaction date Payment date
Monday(01-31-2011) Tuesday(02-01-2011)
Friday (01-28-2011) Monday(01-31-2011)
Saturday (01-29-2011) Monday(01-31-2011)
Friday (12-24-2010) Wednesday (12-29-2010)
Friday (12-25-2010) Wednesday (12-29-2010)

Basically the payment date will be the next business day of the transaction date.Transaction date can be any day, but the Payment date will be business day

the holidays are defined in the HOLIDAY table but the week ends need to identified.

Can some one help me with this calculation. working with CR 8.5 & DB2

Thanks,
 
Your are using a very old version of Crystal which does not support shared arrays. So you will need to hard code the Holiday dates into an array in the main report.

Then do a do while loop testing a datevar to make sure dayofweek() function does not return 1 (sunday) or 7 (saturday) and is not in your holiday array. If is is any of those then add 1 day to datevar and retest.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top