[EpiData-list] date field: check fails

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Thu Aug 6 17:18:47 CDT 2009

I cannot reproduce this result. EpiData lets you enter extra digits if 
you do not enter the "/". When I try this, the extra digits get removed 
and the date goes through as though they were not entered.


Peter wrote:
> Dear all,
> I'm just starting to use epidata entry so I have probably overlooked 
> something. Any pointers are appreciated!
> I defined a date field as follows in the .qes file:
> DOB    date of birth <dd/mm/yyyy>
> in the .rec file I added the following sanity check:
>     IF ((year(DOB) < 1900) OR (DOB > TODAY)) THEN
>       HELP "This date is not allowed" TYPE=ERROR
>       CLEAR DOB
>       GOTO DOB
>     ENDIF
>   END
> Most of the time the field behaves as I expect it to: dates in the 
> future or far in the past are not allowed. However, the following typo 
> gets accepted without triggering an error: 05/08/20001. Adding an 
> extra trailing zero (05/08/200010) results in a prompt conversion to 
> 05/08/3402, and the sanity check works again. Some experimentation 
> seems to confirm that values between 20000 and 20099 are accepted as 
> valid for year, bigger values trigger either my check or are converted 
> to some weird value, again triggering the check.
> How can I prevent this from happening?

More information about the EpiData-list mailing list