Focal Point
[SOLVED]Format Error doing a DATEDIF for an Age Calculation

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8007086286

June 07, 2016, 11:46 AM
Trudy
[SOLVED]Format Error doing a DATEDIF for an Age Calculation
I am doing and DATEDIF to calculate an age calculation. I am getting the following error when I use the following COMPUTE

 
     COMPUTE AgeAtGrad/A2 = DATEDIF(CEHOLD.SEG01.SYVPER1_BIRTH_DATE, J2.SEG01.EndDateYYMD , 'Y');
 


(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD AgeAtGrad

I am not sure that I am doing this the best/most efficient way. Any suggestions on how to do an age calculation or what format the DATEDIF result should be would be greatly appreciated.

This message has been edited. Last edited by: Trudy,


WF8
Windows
June 07, 2016, 12:29 PM
jcannavo
Hi Trudy,

I'm pretty sure the DATEDIF function is going to return an Integer but you're trying to set that value to Alphanumeric. So I'm wondering if that is the issue? I bet if you switch AgeAtGrad/A2 to something like AgeAtGrad/I9 it will probably work.


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
June 07, 2016, 12:31 PM
Ricardo Augusto
http://documentation.informati...ource/datetime10.htm


WebFOCUS 8.1.05 / APP Studio
June 07, 2016, 01:18 PM
Trudy
Thanks for the answers, worked great.


WF8
Windows