How do I subtract the current date from a date in a table field?
I have dates in a field, e.g. 7/15/1980, and in my query, I have the current
date, Date(). I am trying to subtract the two and get the age in years. My
function works, but I am getting a message box, stating that I don't have
Date() as one of my tables parameters.
I want to get rid of the message box and have the query do the calculations
without any user prompts. Here is my function - Age:
DateDiff("yyyy",[DOB],[Date()])
Can anyone help me with this?
Antney
Ofer Cohen - 17 Aug 2007 01:47 GMT
Remove the square brackets from the date function, other wise it will look
for a field with this name
DateDiff("yyyy",[DOB],Date())
Also, see this link:
http://www.mvps.org/access/datetime/date0001.htm
Date/Time: Calculate Age of a person

Signature
Good Luck
BS"D
> How do I subtract the current date from a date in a table field?
>
[quoted text clipped - 10 lines]
>
> Antney
Antney - 17 Aug 2007 01:54 GMT
Of course!
Thank you!!
> Remove the square brackets from the date function, other wise it will look
> for a field with this name
[quoted text clipped - 20 lines]
> >
> > Antney