Alpha Video Training
Results 1 to 7 of 7

Thread: listing child table records in latest date order

  1. #1
    Member
    Real Name
    ken doucet
    Join Date
    Oct 2005
    Location
    Hamilton, Ontario
    Posts
    195

    Default listing child table records in latest date order

    I have records with a field called start in a child table that I would like to display with the latest date entry showing up first. I tried this format with / without the invert and there is no difference to my display.

    erhist->start
    erhist->invert(start)
    Last edited by ken doucet; 01-27-2006 at 12:25 PM.

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Need details

    Quote Originally Posted by ken doucet
    I have records with a field called start in a child table that I would like to display with the latest date entry showing up first. I tried this format with / without the invert and there is no difference to my display.

    erhist->start
    erhist->invert(start)
    Display where? Form, browse, report, embedded browse on a form, sub-report?

  3. #3
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,877

    Default

    you can design the linking field from the child table to the parent table with multiple fields.

    ie: master table, key field = famname

    child table, linking fields famname +invert(dtos(start))

    so that it will order the child table by famname+ reverse order of start.

    We have had more success using a string representation of the date fields in this type of situation.

    Tom

  4. #4
    Member
    Real Name
    ken doucet
    Join Date
    Oct 2005
    Location
    Hamilton, Ontario
    Posts
    195

    Default Thanks Tom/ Stan - a related question

    Stan - sorry I wasn't clear. It was an embedded browse. I have to get use to the whole Alpha 5 nomenclature and am going through the learning curve.

    Tom- I used your tip and it sorted as I expected. Thanks.

    Another question - in my other database world I populated the company# value from the latest record in the employer history table.

    Is it possible to have a field automatically store the latest comp# value stored in the linked employer history file so that an individual's record would always reflect the comp# of the last record entered there? Would it be a similar approach to the tip Tom provided?
    Is this a valid premise or am I much better off to deal with the logic at the output level?

  5. #5
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,877

    Default

    make it a calculated field using a lookup LAST based on the "individual" key.

  6. #6
    Member
    Real Name
    ken doucet
    Join Date
    Oct 2005
    Location
    Hamilton, Ontario
    Posts
    195

    Default lookup last

    Thanks for prompt repy Tom.

    When does the value stored in the field change? As soon as a record is added to the embedded form or does it happen only when the record is pulled up?

  7. #7
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,877

    Default

    is the employee the parent record? if so, then you could invert the order in the employee->employer hist set, and just place the employer company # on the parent form, and not even keep it in the employee record. This way, as you scroll down the embedded browse, the parent record will remain the same, and just the comapny number will change to reflect the highlighted item in the browse.

    This alleviates the messy posting and updating using field rules.

    Try to keep things simple, it will make your life so much easier. You won't go back in 2 years saying "Now, why on earth did I do that????"

    Tom

Similar Threads

  1. Listing data in a specific order.
    By cello78 in forum Alpha Five Version 7
    Replies: 6
    Last Post: 01-03-2006, 10:06 AM
  2. New records into Child table browse
    By Tom Henkel in forum Alpha Five Version 5
    Replies: 12
    Last Post: 05-16-2005, 06:10 AM
  3. Order/Filter based on Child Table
    By Art Cordaro in forum Alpha Five Version 4
    Replies: 12
    Last Post: 11-18-2003, 11:53 AM
  4. blank records in child table
    By C Johnson in forum Alpha Five Version 4
    Replies: 9
    Last Post: 07-24-2003, 09:45 AM
  5. Order on child table in a set - catch 22
    By brett s in forum Alpha Five Version 5
    Replies: 3
    Last Post: 10-07-2002, 09:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •