2 Replies Latest reply on Jul 13, 2009 10:09 AM by Magneato

    Oh... where to begin



      Oh... where to begin


      My problem is a bit large to be answered all at once, so I really just need to know what direction to head in here...


      I am using 2 tables in this instance.  One table is a database containing referring doctors contact information(RefDr).  Each record from 'RefDr' contains a field with their license# (lic1).  The other table is a db containing patient info (PtInfo).  Each record from 'PtInfo' contains a field with the referring dr's license# (lic1) and a field for each part of the body to be scanned(scan1, scan2, ...)  What I'd like to do is create a field in 'RefDr' that gives a running total of all the body parts scanned from records in the 'PtInfo' table.


      EXP/ Dr. Poopypants has a license# of 1122334455.  Everytime that license# appears in a record from 'PtInfo' I would like the sum of the body parts scanned from that and everyother record containing the same license# to be added to a running total summary field in the table 'RefDr'.


      I have no idea how to write a script but am willing to learn if thats the route I need to go.  Any and all guidance will be appreciated

        • 1. Re: Oh... where to begin

          I believe you should have three tables: Physicians, Patients and Scans. If you connect them in a parent -< child -< grandchild pattern, you should have no problem counting the scans of each physician in a calculation field =


          Count ( Scans::ScanID )




          I am not sure what you mean by "running" total here.

          • 2. Re: Oh... where to begin
               Thank you for the quick reply.  I took your advice... sort of.  By blindly trying different things I was able get what I needed.  I was definitely making it a harder problem than it really was.  On your advice I just simplified a few table relationships and presto!  My next endeavor will no doubt lead me back to this forum.  I hope you're around to help again.