DATE() Prompts ME for date!

M

MsHlyl

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
 
G

Gina Whipp

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())
 
M

MsHlyl

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!

Gina Whipp said:
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())

MsHlyl said:
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
 
D

Duane Hookom

Have you tried to compile your code?
Do you have your own function named Date()?
Do you have a module named Date?

--
Duane Hookom
MS Access MVP


MsHlyl said:
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!

Gina Whipp said:
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())

MsHlyl said:
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
 
K

Ken Snell [MVP]

In addition to Duane's troubleshooting tips, another possible source for
this error is if the refrences are messed up.

--

Ken Snell
<MS ACCESS MVP>


Duane Hookom said:
Have you tried to compile your code?
Do you have your own function named Date()?
Do you have a module named Date?

--
Duane Hookom
MS Access MVP


MsHlyl said:
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!

Gina Whipp said:
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,

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
 
M

MsHlyl

Ken, it was indeed the references; there was one missing.

Thanks!

Ken Snell said:
In addition to Duane's troubleshooting tips, another possible source for
this error is if the refrences are messed up.

--

Ken Snell
<MS ACCESS MVP>


Duane Hookom said:
Have you tried to compile your code?
Do you have your own function named Date()?
Do you have a module named Date?

--
Duane Hookom
MS Access MVP


MsHlyl said:
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.

DateDiff("d",[OPEN_DATE], Date())

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
 
Top