DateDiff error

B

Betty K

I'm using the following formula in a form to calculate the # of yrs between a
date in a table and the beginning of 2009:

=DateDiff("yy",[#01/01/2009#],[Contacts]![Join Date])

The error #Name? populates the cells. What am I doing incorrectly?
 
T

Tom van Stiphout

On Mon, 5 Jan 2009 00:37:00 -0800, Betty K

Allen already gave you the solution. To answer your question: the
brackets arount the date turn it into a field name, just like [First
Name] would, and that field name does not exist. Thus the second
argument does not contain a legal date.

-Tom.
Microsoft Access MVP
 
B

Betty K

Thank you!

Allen Browne said:
Try:
=DateDiff("yyyy", #01/01/2009#, [Join Date])

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Betty K said:
I'm using the following formula in a form to calculate the # of yrs
between a
date in a table and the beginning of 2009:

=DateDiff("yy",[#01/01/2009#],[Contacts]![Join Date])

The error #Name? populates the cells. What am I doing incorrectly?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top