I have a Crystal 9 report that has a running formula that puts together a dynamic array at runtime. The array collects date values. The formula is something like this ..........
The array will look something like this at the end of the report .............
demand_dates[0]=01/01/2006
demand_dates[1]=01/02/2006
demand_dates[2]=01/03/2006
demand_dates[3]=01/04/2006
At the end of the report I want to work out the variation between the dates, ie the standard deviation.
Ideally I want to use the formula std_demand_date = StdDev(demand_dates). But I get a syntax error because the StdDev function requires a number.
How do I transalate a normal date into a serial number to allow a standard deviation calculation.
An example in Excel would be that the 01/01/2006 date is actually stored as the number 38718. Which allows a standard deviation calculation.
Any ideas how to do this in Crystal?
Code:
WhilePrintingRecords;
dateVar array demand_dates;
numberVar d;
demand_dates[d] := date({Command.Date});
d := d + 1;
The array will look something like this at the end of the report .............
demand_dates[0]=01/01/2006
demand_dates[1]=01/02/2006
demand_dates[2]=01/03/2006
demand_dates[3]=01/04/2006
At the end of the report I want to work out the variation between the dates, ie the standard deviation.
Ideally I want to use the formula std_demand_date = StdDev(demand_dates). But I get a syntax error because the StdDev function requires a number.
How do I transalate a normal date into a serial number to allow a standard deviation calculation.
An example in Excel would be that the 01/01/2006 date is actually stored as the number 38718. Which allows a standard deviation calculation.
Any ideas how to do this in Crystal?