Hi Gail,
> Is there a way to set the date/time field in a table to accept an entry
> for year only?
No. You can either enter a fictious month and day (not recommended), or you
can use a text data type instead. If you use a text field, then you can store
any form of date that you want. However, you will likely want to implement
some validation code on a form, so that a user can only enter a valid date or
a year by itself.
You would also need to convert the resulting string to a date on-the-fly in
order to calculate age. Access provides built-in functions for working with
dates including CDate, CVDate, DatePart, DateValue, DateDiff, DateSerial,
etc. For those records where you only have a year available, you could
actually calculate a range, by using January 1 and December 31 as two
month/day inputs.
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
"Gail T." wrote:
> I am trying to calculate age in Access. My problem is this –in some
> instances I only know the year of birth. Is there a way to set the date/time
> field in a table to accept an entry for year only? If not is there a
> solution this issue?
>
> (I working on family tree and in some instances I only know the year of
> birth and complete date of death)
>
> Thanks