marysilvaramos Posted December 6, 2004 Posted December 6, 2004 Hi guys! I am scratching my head finding the way to create a calculation which create a 2nd serial number of transplants based on the transplant date. Here are the details: A patient can be transplanted several times, my users want to know which number of transplant it is. Data sample here: Pat Name Transplant Date Transplant No. JD 08/01/2000 1 JD 09/13/2000 2 JD 01/01/2001 3 I want to create a calculation field to calculate the "transplant no" . . In addition, I must to say that some records might be marked as "deleted" (The table as a field called "deleted" which marks the record when the user deletes the record). The deleted records should be omitted from the calculation. Thanks in advance, Mary
transpower Posted December 6, 2004 Posted December 6, 2004 Assuming your "data_sample" is a field, use Right(data_sample ; 1). This could be put into an If function: If ( deleted <> "deleted" ; Right ( data_sample ; 1 ); "" ) I'm assuming (hopefully!) you don't have patients with more than 9 transplants! Also, I'm assuming that patient initials are always 2 characters. In retrospect, I think it would be better to have a join file: patient_transplant, with one record per transplant. Really, you should use patientID as a key field. Then you could concatenate the patientID and an underscore and the transplant number as your serial number.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now