not capturing Interview date and start/end time

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
mariam.malik
Posts: 6
Joined: March 9th, 2021, 5:43 am

not capturing Interview date and start/end time

Post by mariam.malik »

I have recently shifted it to CSPro 7.5. When i enter the cases, its not obtaining Interview date, start and end times as well as GPS coordinates are there in one test case and absent in other test case? can you all kindly see the below code and help please? Urgent response needed

PROC INTERVIEW_DATE

Preproc
// Prefill interview date with current date

if $ = notappl then
INTERVIEW_DATE = sysdate("DDMMYYYY");
endif;

PROC INTERVIEW_END_TIME

if $ = notappl then
INTERVIEW_END_TIME = systime("HHMM");
endif;

PROC INTERVIEW_START_TIME

Preproc
// Prefill interview start time with current time

if $ = notappl then
INTERVIEW_START_TIME = systime("HHMM");
endif;
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: not capturing Interview date and start/end time

Post by Gregory Martin »

One problem with your code may be that your logic for INTERVIEW_END_TIME is in the postproc, not the preproc (as you have in your other two procedures).

Also, keep in mind that if you think that enumerators will modify cases, you will be overwriting the data each time they revisit the field. Unless you want this behavior, you would change the code to something like this:
PROC INTERVIEW_START_TIME

preproc

    if visualvalue
(INTERVIEW_START_TIME) = notappl then
       
INTERVIEW_START_TIME = systime("HHMM");
   
endif;
You might also consider looking at the timestamp function. It's an easy way to capture the date and time in one number.
Post Reply