@ Aftab Ahmad
Just what are you talking about here?
The ampersand is
not a mathematical operand in this case. It is used to combine two strings (concatenation of strings).
>> Your returned value of 336months is most courious and I do think that you have most likely mis-keyed your values.
>> where did you come up with:
=[years] & "/" & [months] = 28/336
not only did neither Rabbit nor I suggest or provide such a formula, it will not evaluate as you've suggested. Instead, the engine will take the [Year], backslash, and [Month] as literal string value and return the concatenation of these as a string value without any evaluation in either a calculated field or control.
Furthermore:
A) If we use your "birth day" of 05/03/1987 and today's date of 11/10/2015 and calculate the number of months we get:
datediff("m",#05/03/1987#,#11/10/2015#)
=342mo
a1) Quick verification of the elapsed years using the ever so classic method of:
[HistoricalYear]-[CurrentYear] == 2015-1987 == 28years
using the conversion of (12mo/yr) gives us 336 months plus the residual count between May to December (ignoring residual days) of 6 months for a grand total of
336+6=342mo
B) Using the integer divisor operand "\" we calculate the number of years using the base conversion of (1yr/12mo)
342\12
=28yrs
b1) We've already verified this result under Step-a1
C) Now we need the remainder that would have been returned from the prior division if we had used the standard divisional operand (returning 28.5yrs). This is most easily determined by using the
Mod()
to return the modulus value against 12 of the 342
342 mod 12
= 6
Quick verification:
==(342 - (28 * 12) )
==(342 - (336) )
== 6
Both in agreement with the fractional part of 0.5yrs == 6mo
+ The remainder of this situation would be concatenation of the results from Step B and Step C
B() & "yrs " & C() & "mo"
==
>>
28 & "yrs " & 6 & "mo"
==
"28yrs 6mo"
You can verify this yourself in any VBA enabled Office program by pressing <ctrl><g> and typing the "?" followed by the above formulas to return the values of the calculations.
@strive4peace
That was already implied in Rabbit's
post#2
The question has become does CindySue know how to create the calculated field, to whit, I have provided a link to a fairly decent tutorial that describes each step to a reasonable degree (IMHO).