10-08-2020, 04:56 PM
Hi Stam,
The following code will work with your existing data model. It will give you an array with the data for the people that match the criteria.
Let me know if you have any questions.
The following code will work with your existing data model. It will give you an array with the data for the people that match the criteria.
Code:
local tEncounterDataQueryA, tSelectedDate, tForeignKeys, tPersonDataA
put cdb_Query("date", "=", tSelectedDate, "encounterDataTable", "cloud", "recordData") into tEncounterDataQueryA
repeat for each key xRecordID in tEncounterDataQueryA
put tEncounterDataQueryA[xRecordID]["foreignKey"] & lf after tForeignKeys
end repeat
delete char -1 of tForeignKeys
put cdb_read("personDataTable", tForeignKeys, "cloud") into tPersonDataA
Let me know if you have any questions.