cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports - Getting the Age using Parameter Value and Current Date

Former Member
0 Kudos

I'm trying to get the age of my user in crystal report using parameter and current date.

This is my formula for the crystal report.

INT ((CurrentDate - {?txtbdate}) / 365.25)

For example: the date in {?txtbdate} is 1996-07-29 and today is 2018-10-26.

The age must be 22.

When I execute it, a popup message appear saying "A number is required here."

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor

Hi Aldrin,

Change the datatype of the {?txtbdate} parameter to Date.

If you wish to keep it as string, then modify the formula to:

datevar d := if isdate({?txtbdate}) then date({?txtbdate});
INT ((CurrentDate - d) / 365.25)

-Abhilash

Former Member
0 Kudos

Thank you so much!

Answers (0)