×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Business Objects: Crystal Reports 1 Formulas FAQ

Formula Help

 How do I work out an exact age (in years & months) without CR rounding up? by phil2k faq767-4120 Posted: 5 Sep 03 (Edited 14 Jul 06) This formula converts the numbers to text so that the decimal places can be trimmed of without being rounded up. It works perfectly for people up to 99 years 11 months of age (could be modified to go higher)numbervar var_totalmonths := DateDiff "m",{table.Date of Birth},{table.Target Date});stringvar var_remainingmonths := Totext(var_totalmonths mod 12);stringvar var_years := ToText(var_totalmonths/12);stringvar var_yearstrimmed := If Length (var_years) = 5 Then (Left(var_years,2)) Else (Left(var_years,1));stringvar var_remainingmonthstrimmed := If Length (var_remainingmonths) = 5 Then (Left(var_remainingmonths,2)) Else (Left(var_remainingmonths,1));Cstr(var_yearstrimmed) + "yrs" + Cstr(var_remainingmonthstrimmed) + "mths"Philphilip.richardson@sch.nhs.uk Back to Business Objects: Crystal Reports 1 Formulas FAQ Index Back to Business Objects: Crystal Reports 1 Formulas Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!