Extract years of an patient

date is coming in char format like this for eg:- 56 years 6 months 15 days how to extract 56 years only in this field itself and make another field dependent on this field and range of age between 18 to 35.
Any help wiil be grateful.

Any another method to execute above issue will also be appreciable.

This is not a date. At best it is a timedelta (even if months are not standardized).

You have to write a parsing method.

1 Like