June 10, 200520 yr Remind me to wash all of your cars or something...for all the help you guys have given me. I have a field -- Visit Date I have a field -- Last Visit Date I would like Last Visit Date to automatically contain the field from 'Visit Date' in the last related record. more specifically, a patient has a visit. and we want to know when their previous visit was in a field. i would love to have this as just a calculation field rather than a script... is it possible? Thanks so much in advance.
June 10, 200520 yr Create selfrelation such that Visit_Date<=Visit_Date and Patient=Patient Sort your relation(let his name is Patient_Last_Visits) by Visited_Date-descending then your Last_Vist=Clients_Visit::Visit_Date.
June 10, 200520 yr To clarify, the relationship should be Visits 2::Patient = Visits::Patient AND Visits 2::Visit_Date < Visits::Visit_Date You do not want to use <= or the current record's date will be included. You will probably be defining it in the opposite direction, and so will be using > instead of <. Also, if you sort the relationship as aaa suggests, then you do not need a Last Visit Date field; you can simply put the related Visit_Date field directly on the layout.
Create an account or sign in to comment