Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date() does not work in my text box

Status
Not open for further replies.

ScorpioMCN

Programmer
Feb 13, 2003
40
US
I have a form in Access 2000 and I'm using the formula

Date() as the default value but I get this error in the date field when I add a new record
#Name?

Now() works but I do NOT want the time - only the date.

How can I fix this? Would appreciate any help.
 
Although not a cure to the cause
=int(now())
should return just the date. If that does not work then use
=cdate(int(now()))

There was another recent post with the same problem, and I think it had something to do with the computers battery or bios.

The reason the above code works is because a date is stored with an integer portion and decimal portion. The integer portion represents the elapsed days the decimal is the fraction of a day (the time).
 
ScorpioMCN said:
Now() works but I do NOT want the time - only the date.
Just set the formatting to display only the month, day and year and you are set.


 
I have Access 2000. I have a field with data type Date/Time. I used =Date() as the default and it worked fine.
 
Of course it does! And rightfully, too! It's always worked for me in ACC2000/ACC2003, as well. But something really strange is going on out there! This is the forth post (all by different people) that I've seen in the past week in various forums, all complaining of the same thing. And in every case, while Date() doesn't work, Now() does, which makes no sense!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top