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
-
josh
- Posts: 2403
- Joined: May 5th, 2014, 12:49 pm
- Location: Washington DC
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.
-
lb.fam
- Posts: 13
- Joined: March 17th, 2015, 7:32 pm
Re: Calculate Age
That worked (I had ddmmyyy format).
Thanks.
Thanks.