Hello All,
I am trying to calculate the age of an item by doing the following (where
OPEN_DATE is a field in a table and DATE() is the current date):
DateDiff("d",[OPEN_DATE],[ DATE() ])
It is actually giving me the number of days difference, HOWEVER, it is
prompting me for the current date rather than taking the system date. Can
someone explain to me what I am doing wrong? Why isn't it using the system
date? Why is it prompting me for the value?
Thanks!
MsHlyl
Gina Whipp - 31 Aug 2005 02:08 GMT
Try removing the brackets from around Date(), it thinks [ DATE() ] is a
field in your table/query and since it isn't it's prompting you to enter it.
DateDiff("d",[OPEN_DATE], Date())
> Hello All,
>
[quoted text clipped - 12 lines]
>
> MsHlyl
MsHlyl - 31 Aug 2005 02:54 GMT
Gina, Thanks for the suggestion. I removed the brackets but it gave me the
following error:
"Undefined function Date in expression."
Would you happen to have any further suggestions? I would appreciate any.
Thanks!
> Try removing the brackets from around Date(), it thinks [ DATE() ] is a
> field in your table/query and since it isn't it's prompting you to enter it.
[quoted text clipped - 17 lines]
> >
> > MsHlyl
Duane Hookom - 31 Aug 2005 06:04 GMT
Have you tried to compile your code?
Do you have your own function named Date()?
Do you have a module named Date?

Signature
Duane Hookom
MS Access MVP
> Gina, Thanks for the suggestion. I removed the brackets but it gave me
> the
[quoted text clipped - 30 lines]
>> >
>> > MsHlyl
Ken Snell [MVP] - 31 Aug 2005 14:02 GMT
In addition to Duane's troubleshooting tips, another possible source for
this error is if the refrences are messed up.

Signature
Ken Snell
<MS ACCESS MVP>
> Have you tried to compile your code?
> Do you have your own function named Date()?
[quoted text clipped - 35 lines]
>>> >
>>> > MsHlyl
MsHlyl - 31 Aug 2005 19:16 GMT
Ken, it was indeed the references; there was one missing.
Thanks!
> In addition to Duane's troubleshooting tips, another possible source for
> this error is if the refrences are messed up.
[quoted text clipped - 38 lines]
> >>> >
> >>> > MsHlyl