Hi
Using timestamp function given at https://www.csprousers.org/help/CSPro/t ... ction.html i tried to calculate survey time duration, but its not working. CAPI application is attached, appriciated if someone please review and let me know what is the issue and how can be solved. thanks
Survey duration error
Survey duration error
- Attachments
-
- Test.rar
- (36.74 KiB) Downloaded 321 times
-
- Posts: 1801
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Survey duration error
Your calculation is done PROC UPLOAD_PICTURES_ID, so it's only recording the time to fill the ID field. You want to move it into the level procedure so that it is executed prior to data entry, and then after the case is entered.
PROC UPLOAD_PICTURES_LEVEL
preproc
surveyStartTime = timestamp();
postproc
SURVEY_DURATION = timestamp() - surveyStartTime;
Note that this is not 100% correct, as the duration value would be overridden if the case were modified (after an initial entry), but if that is not a concern, this should be fine.preproc
surveyStartTime = timestamp();
postproc
SURVEY_DURATION = timestamp() - surveyStartTime;