So the history is basically stored in the data fields, correct?
Assuming you're looking for the status at the end of the month, here's what I would do (this is going to be complicated and may not be complete, so you're going to have to play with it and tweak it.):
1. Create a formula called InProgressDt to get the most recent "In Progress" date. It will look something like this:
If isNull({changenote.dateintegrated}) then
if isNull({changenote.datedeveloped}) then
{changenote.dateanalysed}
else
{changenote.datedeveloped}
else
{changenote.dateanalysed}
2. Create a formula called OpenMonth to get the month of the open date:
month({changenote.datesubmit})
For CloseMonth do the following:
if isNull({changenote.datedeployed}) then 0
else month({changenote.datedeployed})
Use this same technique for InProgressMonth, using the month of the
{@InProgressDt} formula.
Note: With just the month, you'll only be able to run this for the current year. If you need to run it for multiple years, you'll want to do something like this:
ToText(year({changenote.datesubmit}, 0) +
right('0' + ToText(month({changenote.datesubmit}, 0), 2) This code gives you the 4-digit year appended with a two digit month that has a leading zero if it's a single-digit month number. You need to do it this way in order to get it to sort correctly.
4. Create a command that gets your list of months. I don't know what type of database you're using but in Oracle it would look something like this:
For just the month:
Select to_Number(to_Char(datesubmit, 'MM')) as GroupMonth
from ChangeNote
For the year and month:
Select to_Char(datesubmit, 'yyyyMM')) as GroupMonth
from ChangeNote
Use the syntax that is correct for your database. DO NOT link this command to any of your tables! Crystal will complain about it, but if I understand your needs correctly, you want to evaluate the records multiple times - once for each month between the datesubmit and the datedeployed.
5. Create a group on the GroupMonth field.
6. Create a formula called IsOpened:
Create another formula called IsInProcess:
7. Sum each of these formulas at the GroupMonth level to get the numbers that you need for your bar chart.
-Dell