To get the counts for particular dates, you would have to create a formula for each date in the period. First you should change your record selection formula to something like:
{view_episode_summary_current.program_value}= {?Program} and
{admission_data.discharge_date} >= {?Start Date} and
{admission_data.admission_date} <= {?End Date} and
{view_episode_summary_current.FACILITY}=1
You will need to decide what the maximum number of days in the range will be and then create one formula per day, as in:
//{@day1}:
local numbervar i := 0;
local numbervar j := datediff("d",{?Start Date},{?End Date})+1;
local datevar array x;
redim preserve x[j];
for i := 1 to j do(
x := {?Start}-1+i
);
if x[1] >= {admission_data.admission_date} and
x[1] <= {admission_data.discharge_date} then 1
//{@day2}:
local numbervar i := 0;
local numbervar j := datediff("d",{?Start Date},{?End Date})+1;
local datevar array x;
redim preserve x[j];
for i := 1 to j do(
x := {?Start}-1+i
);
if x[2] >= {admission_data.admission_date} and
x[2] <= {admission_data.discharge_date} then 1
Notice that the only change in the formula is the subscript in the last clause of each formula. Repeat for all possible number of days. Then place these in your detail section and right click on each and insert sums at the group or report level.
-LB