How to retrieve data from related past records

老子叫甜甜 提交于 2020-01-15 15:34:12

问题


I am using Filemaker Pro 12. I want to create a student report that contains results from previous terms. For example, each year there are 4 terms. The report in term 1 contains only the result of term 1. But in term 2, the report contains the results from both term 1 and term 2. This continues until term 4 (end of year) which the report will contain the results from term 1 to term 4.

I created 4 fields ca1_percent, sa1_percent, ca2_percent and sa2_percent in the Results table. My Results table contains all the records of the past results. My relationship graph is shown in the diagram below:

My problem is that I kept obtaining the records (mark_percent) from CA1 only. My fields calculation is shown in the diagram below:

Can anyone help me?

Update: The result I obtained from above is shown in the picture below. I have populated upto term 3 results.


回答1:


Just a thought - might an ExecuteSQL() query to fetch the related ids as a value list, then plonking them into a id-1, id-2, id-3 be more flexible?




回答2:


I solved the problem myself.

Since Filemaker just take the first matched record by default, what I did is to use GetNthRecord(SA1_Results_Match::mark_percent,2) to get the marks for SA1, using 3 to get the marks for CA2 and 4 for SA2.

My TO only need be matched by overall_percent_match which is a calculated field using year & " " & subject & " " & _kf_studentID.



来源:https://stackoverflow.com/questions/16775575/how-to-retrieve-data-from-related-past-records

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!