Attempting to calculate the age based on dates which have been entered by a user using the date picker.
The items are 8 character numeric and reside within different records.
The calculation is carried out within a roster.
PROC AGE
preproc
$ = datediff(DATEOFBIRTH(currIdx),INTERVIEWDATE(currIdx),"y");
When I run this code the age field remains blank. Any idea how to resolve?
Calculate Age
Re: Calculate Age
Make sure that you have the date format set to YYYYMMDD in the field properties for both date fields. Datediff only works if values are in this format.
Re: Calculate Age
That worked (I had ddmmyyy format).
Thanks.
Thanks.