thatgirlinMS
Programmer
I am a pretty advanced report designer but this has me baffled and it's driving me CRAZY! I'm working on some data that uses a gabillion tables for everything. I have a report of all discharged patients during a time frame. I am grouping by patient number. I have a diagnosis table, a table of when the diag was assigned, and a diagnosis type table. The ending value I need to have is the LAST (max effective date) assigned primary diagnosis.
It would be great if I could make a couple of variables (effdate and diag) somewhere in the crystal report and then have a formula field that checks to see if the currently read date is greater than the variable-stored date....if so, store the new date and corresponding diag.
This formula would print at the group footer level and need to be reset for each patient.
I even began by making a running total of the max of the diag assign date (based on if the diag is primary and reset on group change). I then thought I could just check to see that the current detail diag assign date = max(running total date) and is primary, then that detail's diag code would be the one I need.
I am currently getting the results I need using subreports but they cause the report to run entirely too long and will not export in csv format.
Did I do a decent job of explaining what I need? Can anyone help me?
Thanks in advance!
It would be great if I could make a couple of variables (effdate and diag) somewhere in the crystal report and then have a formula field that checks to see if the currently read date is greater than the variable-stored date....if so, store the new date and corresponding diag.
This formula would print at the group footer level and need to be reset for each patient.
I even began by making a running total of the max of the diag assign date (based on if the diag is primary and reset on group change). I then thought I could just check to see that the current detail diag assign date = max(running total date) and is primary, then that detail's diag code would be the one I need.
I am currently getting the results I need using subreports but they cause the report to run entirely too long and will not export in csv format.
Did I do a decent job of explaining what I need? Can anyone help me?
Thanks in advance!