Hi,
For the data we collect date of birth, and other historic dates, are not always complete. The response to " What is your date of birth" is sometimes 22-OCT-1972 or OCT-1972 or just 1972.
To collect data for such partial dates we create three fields, one each for day, month and year and restrict input accordingly.
dob_dd: 1-31 or 99
dob_mm: JAN - DEC or UNK; coded 1-12,99
dob_yy: 1945 -2015
We can then concatenate the three fields to get "dob" , a calculated field. If the day or month is unknown ; i.e 99, we substitute the 99 with a standard missing value for day and date; 28 and 12 respectively.
So if collected date was 99-OCT-1972 we would create 1972-10-28
If collected date was 99-UNK-1972 we would create 1972-12-28
We then need to use the dob so generated to calculate the age. We but this doesn't work.
For example, if dob holds the concatenated age as 1972-10-22, using
(today() - ${dob}) div 365.25
or
(today - date(${dob})) div 365.25 does not work.
Is there a way I can get this to work?
If not, how do people deal with partial dates in the data that they collect?
Just to let you know that we use XLSForms
Clemens