Hi
I am using CR9 on a Windows XP/SP2 computer accessing an Access 2002 database. I'm just learning variables etc. so please bear with me.
I have a database with patient visit data. I have a one to many relationship with the Main table (one) and diagnoses (many).
The main report is based on the Main table and diagnoses are in a subreport linked by account # (unique). The main report is grouped by principle procedure and I want to summarize specific codes per principle procedure.
I created the formula in the subreport:
shared numbervar cancer := 0;
If {@CancerFlag} >= 1 then cancer:=cancer+1 else 0;
Note: The formula of @CancerFlag is looking at all diagnoses and picking out certain ones.
I place this formula in the subreport and in the main report I have a field where I call the variable:
whileprintingrecords;
shared numbervar cancer
This works in terms of no errors but the variable only shows 1. How can I summarize on the variable to tell me how many cases of cancer flag there are?
Note: ideally I want the variable of cancer to loop through all diagnoses per account number and only report +1 no matter how many times one of the valid cancer flag codes show up. However, I think I can solve that problem by using the summary of distinctcount versus sum (if I can actually sum on the variable in the first place)
All assistance greatly appreciated - thanks.
Shelby
I am using CR9 on a Windows XP/SP2 computer accessing an Access 2002 database. I'm just learning variables etc. so please bear with me.
I have a database with patient visit data. I have a one to many relationship with the Main table (one) and diagnoses (many).
The main report is based on the Main table and diagnoses are in a subreport linked by account # (unique). The main report is grouped by principle procedure and I want to summarize specific codes per principle procedure.
I created the formula in the subreport:
shared numbervar cancer := 0;
If {@CancerFlag} >= 1 then cancer:=cancer+1 else 0;
Note: The formula of @CancerFlag is looking at all diagnoses and picking out certain ones.
I place this formula in the subreport and in the main report I have a field where I call the variable:
whileprintingrecords;
shared numbervar cancer
This works in terms of no errors but the variable only shows 1. How can I summarize on the variable to tell me how many cases of cancer flag there are?
Note: ideally I want the variable of cancer to loop through all diagnoses per account number and only report +1 no matter how many times one of the valid cancer flag codes show up. However, I think I can solve that problem by using the summary of distinctcount versus sum (if I can actually sum on the variable in the first place)
All assistance greatly appreciated - thanks.
Shelby