0

Returning values from a child table based on field value.

I'm trying to build a database to help me manage my honey bee colonies.  I have a table titled 'Inspection Form' which is a child table to 'Colony Information'. Each Colony has a name and unique Id that is linked through the child table 'Inspection Form'.  Each Inspection has a date field and each colony will have many inspections.

I'm trying to build a code to flag a hive that hasn't been inspected for 8 days to prevent swarming.  

I'm not a computer programmer so I haven't had much luck.  I tried some let functions and I can return the last hive inspection date field from the child table but it is the last inspection for all of the colonies, not the colony I am currently viewing.  I tried conditional formatting but I can't format a date conditionally - the option isn't there in a table view under the show/hide column option.  Any help you can give me would be greatly appreciated and the bees will thank you!

1 reply

null
    • Nick
    • 3 yrs ago
    • Reported - view

    First of all, make sure that in the 'Inspection Form' table the reference Composition option is set to yes (It is easier this way).

    Screenshot 2021-04-09 at 08.41.16

    Then, in Colony Information table create two formula fields e.g.:

    1. Last Inspection

    last('Inspection Form'.'Date Inspection')

     

    2. Days from last inspection

    let a := last('Inspection Form'.'Date Inspection');
    let t := today();
    days(a, t)

     

    This will give you the number of days.

    I hope it helps.

Content aside

  • 3 yrs agoLast active
  • 1Replies
  • 279Views