Join notes with cases
Posted: March 23rd, 2020, 4:32 pm
I´m not an expert in SQL (very very far from that).
I was trying to read the notes attached to the variables, and finally I got it! And it worked, writing the noes contents to the WS and then to a csv file.
My query was
numeric ret = sqlquery(BRUMA_10_ENTREVISTA_DICT, entrySessions,
"select cases.key, notes.field_name, notes.record_occurrence, notes.content, notes.case_id from notes join cases on notes.case_id = cases.id");
The problem is that now I want to have access to the variables in the questionnaire, that is, I want to join the questionnaire, to be able to display, for example, the date when this questionnaire was filled, the device_id, the user_id (these are variables belonging to one of the record types, the X_record).
Is it possible?
Can you point me towards one of the examples, if you have them?
Or write a snipet simulating that?
I was trying to read the notes attached to the variables, and finally I got it! And it worked, writing the noes contents to the WS and then to a csv file.
My query was
numeric ret = sqlquery(BRUMA_10_ENTREVISTA_DICT, entrySessions,
"select cases.key, notes.field_name, notes.record_occurrence, notes.content, notes.case_id from notes join cases on notes.case_id = cases.id");
The problem is that now I want to have access to the variables in the questionnaire, that is, I want to join the questionnaire, to be able to display, for example, the date when this questionnaire was filled, the device_id, the user_id (these are variables belonging to one of the record types, the X_record).
Is it possible?
Can you point me towards one of the examples, if you have them?
Or write a snipet simulating that?