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 value from a different group- CR 8.5

Status
Not open for further replies.

Ruune

Programmer
Jun 7, 2006
33
US
I'm writing a report for one of our medical facilities that shows patient movements (physical- not.. well.. you know). Each time a patient is moved, there is a record created with the Date and time (two different fields, but I have concatenated them into one datetime), movement type, Patient ID, Name, and unit value (this is the hospital unit that they're assigned to).

I need to group the report by movement type, then by patient. However, I need to display the previous unit value- even if it is in another group.

Any ideas?

Thanks in advance!


 
You use the latest patient details with the latest 'unit value'. But you also want to show the 'previous unit value', which will be on an older patient record and may be grouped elsewhere?

I suggest you add patient details again, as an 'alias'. Just make the selection, Crystal will do the rest. Link the patient number in the record and the alias field.

Best also to use a 'left outer' link, so that you still get details if no such record exists. This also means you'll not be able to do any selection on the 'alias'. You will also have multiple records and may need to do further grouping.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
You use the latest patient details with the latest 'unit value'. But you also want to show the 'previous unit value', which will be on an older patient record and may be grouped elsewhere?

I suggest you add patient details again, as an 'alias'. Just make the selection, Crystal will do the rest. Link the patient number in the record and the alias field.

Best also to use a 'left outer' link, so that you still get details if no such record exists. This also means you'll not be able to do any selection on the 'alias'. You will also have multiple records and may need to do further grouping.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
(Sorry to have double-posted. I thought i'd just done it once.)

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
so you're saying add the source table again as an alias, thus having two identical source tables with different aliases? I'm lost...
 
Suppose you have a table called PATIENT. If you add it again it will be added as PATIENT_1. You can then treat it exactly as if it were a separate file on your database.

It's the simplest way within Crystal to use details from two records in the same table for a detail line. Crytal will treat it just the same as if they were two different tables.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
interesting idea... however, I think Im going to do it with a subreport.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top