What is the value of the $MyNumber attribute, i.e. before it is used in the display expression?
Your ‘agent query’ looks wrong. Don’t you mean the agent action? However, that’s not how you sum the agents children.
The query finds notes that match the query, make an alias of each as a child of the agent. The agent’s action is performed upon each of those aliases. However, you want the agent to show the sum of the child $Period values. For that, set the agent’s $Rule [sic] to:
The $MyNumber attribute for the agent should now hold that sum as an integer number. Now we add code to the same rule to make the overall display string:
$MyString = $Name+" – Total Time = "+floor($MyNumber/60)+"/"+mod($MyNumber,60)+" hours/minutes";
Lastly, in the display expression box on the text Inspector, you simply enter:
Thus if the the sum in the agent $MyNumber were
310 (minutes), $MyString would be
Test cell – Total Time = 5/10 hours/minutes.