AnsweredAssumed Answered

I have a parent table and a child table. Each parent record has several children. The child contains...

Question asked by deathrobot on Jul 2, 2013
Latest reply on Jul 3, 2013 by deathrobot

Post

     I have a parent table and a child table. Each parent record has several children. The child contains a text field (called "firstRun") that always starts with month day, year (e.g. "January 1, 2013") then has some additional text. On a layout in the parent table, I need to show only the earliest date from the several children. I've solved it, but am certain I've chosen an unnecessarily circuitous method of accomplishing this. Any suggestion on how to make this simpler? Here's what I have:

     A TO of the child table whose sole purpose is for sorting the date field

     In child table, 4 unstored calculations (already a bad sign…)

         
  1.           %firstRunDateDay = GetAsNumber ( MiddleWords ( firstRun ; 2 ; 1 ) )
  2.      
  3.           %firstRunDateMonth = LeftWords ( firstRun ; 1 )
  4.      
  5.           %firstRunDateYear = GetAsNumber ( MiddleWords ( firstRun ; 3 ; 1 ) )
  6.      
  7.           %firstRunDateFull = LeftWords ( firstRun ; 3 )

     The relationship is sorted via the graph like this:

         
  1.           %firstRunDateYear (ascending)
  2.      
  3.           %firstRunDateMonth (custom order based on a value list that has the 12 months in order)
  4.      
  5.           %firstRunDateDay (ascending)

     The parent table has as single unstored calculation to show the earliest date:

     LeftValues ( 
          List (
               ChildTable::%firstRunDateFull
          );
          1
     )
      
     So, this works but took a sorted TO, 5 unstored calculations, and a custom value list. Would love to be educated on how to simplify this.
      
     Thanks!
     Michael

Outcomes