Calculate Age

Discussions about CSEntry
Post Reply
lb.fam
Posts: 13
Joined: March 17th, 2015, 7:32 pm

Calculate Age

Post by lb.fam »

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?
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Calculate Age

Post by josh »

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

Post by lb.fam »

That worked (I had ddmmyyy format).

Thanks.
Post Reply