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

dynamic loop

Status
Not open for further replies.

mberni

IS-IT--Management
Jul 25, 2001
197
DE
Hi!

Env: CR 9.0 Developer Edition ->Informix 9.4 DB

We have a contract database with 4 fields

customer_id integer
contract_number integer
begin_date date
end_date date

Now i want to compose a report with two date-parameters (start, end) which gives the number of active contracts at the end of each month between <start> and <end>.

a contract is concerned "active" when the end of month from the loop is between begin_date and end_date (in case the contract is canceled by end_date) or end of month is >= begin_date and end_date is empty (in case the contract is still active).

e.g.
start = 01.01.2005
end = 30.06.2005

output:

customer 1:

31.01.2005: 10
28.02.2005: 12
31.03.2005: 8
30.04.2005: 10
31.05.2005: 12
30.06.2005: 15

customer n:

...

At the moment i have one computed field per month which is set to 1, if a contract is active at that point, with a a sum/month in the footer, but this way i cannot use the start and end parameters since the formulas are fixed.

is there a way within crystal do achieve a dynamic report?

thank you.
 
Hi,
Can you post the formulas?
What about them makes it impossible to use parameters for your date range?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi turkbear, thanks for your response.

the january-formula looks like :
Code:
if cdate(2005,01,31)>={contracts.begin_date} and (cdate(2005,01,31)<={contracts.end_date} or {contracts.end_date}=cdate(1899,12,31)) then
    formula=1
else
    formula=0
end if

I have absolutely no idea how to accomplish not to have one separate hard-coded formular for each end_of_month within the report range.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top