Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Previous data

Status
Not open for further replies.

Rosy1

Technical User
Aug 6, 2003
19
0
0
US
I am trying to run a report that is looking at current results and displaying the same patient's previous result. I thought I had the report working until I really looked at the data and realized all I was doing was displaying the results for the previous patient on the report. I know this is probably something very simple, but I am missing it.

Thanks... Rosy1
 
If you group on the patient ID, then you could use a formula like the following for the previous result:

if {table.patientID} = previous({table.patientID}) then
previous({table.result})

If the report is sorted by date, then you could put all fields along with this formula in the group footer and suppress the detail section. Then only the last two sets of results will be displayed per patient.

-LB
 
I am still working on this report and my problem now is that I am looking for a previous result within the last 30 days. Using the formula that I was given I get the previous result, but if there were multiple results for the same test in the past 30 days I get the oldest result not the most current. For example if the patient had a result on January 10th, and again on January 24th and I run the report today, I see the result from January 10 not the more relevent one on the 24th. Does any one have a way around this issue?
Thanks... Rosy
 
Post the formula you used, it doesn't take that much effort.

If the dates are sorted ascending, as LB suggested, then you'll get the most recent one back.

Of course your requirement is so vague, and LB guessed at what you needed because you didn't post technical information.

Best is to supply:

Crystal version
Database/connectivity
Example data
Expected output

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top