10-10-2020, 09:10 PM
(10-08-2020, 04:56 PM)efrain.c Wrote: 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.
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.
Thanks Efrain - that pretty much matches what i was planning to do (i.e. run two different queries).
Is there a worthwhile speed benefit to changning the data model to include all data in a single table do you think?
Or would any benefit be too negligible to be worth the trouble?