i have a question regarding the DateDiff function. I am quite new to access
and seem to have hit a snag with this function. My problem is as follows:
I have a table field that list a persons DateOfBirth. The standard format
for this field is yy.mm.dd (ie- 73.02.01). And on the form that the field is
brought into the input mask for the field is 00.99.99;0;_
What i want to do is have another field on the form that generates the
persons Age. Now, i checked out Microsofts website and they list an example
that makes the Birthdate filed be set to Short Date and for the Age field to
have the following control source:
=DateDiff("yyyy ", [Birthdate], Now())+ Int( Format(now(), "mmdd") <
Format( [Birthdate], "mmdd") )
Now, this will generate a number but the only problem
is that for a birthdate of 73.02.01 it will display 31, but for a
birthdate of 28.03.02 it will generate a negative number.
How can I rectify this problem? Your input is appreciated.
and seem to have hit a snag with this function. My problem is as follows:
I have a table field that list a persons DateOfBirth. The standard format
for this field is yy.mm.dd (ie- 73.02.01). And on the form that the field is
brought into the input mask for the field is 00.99.99;0;_
What i want to do is have another field on the form that generates the
persons Age. Now, i checked out Microsofts website and they list an example
that makes the Birthdate filed be set to Short Date and for the Age field to
have the following control source:
=DateDiff("yyyy ", [Birthdate], Now())+ Int( Format(now(), "mmdd") <
Format( [Birthdate], "mmdd") )
Now, this will generate a number but the only problem
is that for a birthdate of 73.02.01 it will display 31, but for a
birthdate of 28.03.02 it will generate a negative number.
How can I rectify this problem? Your input is appreciated.
Comment