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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grab Current Date in a field

Status
Not open for further replies.

tyleri

Programmer
Jan 2, 2001
173
US
How can I set up a new record to grab a current date and insert that date into the field. The kicker is that I don't want that date to change if the record is updated. Only want it to be automatically inserted on the creation of a record... any ideas?
 
You do this in the design of the TABLE itself.

In the field that is to hold the date value you set the "Default Value" parameter to DATE()

When a NEW record is created it takes the computer's locally known system date and puts that in the field. When the record is viewed in future the data will remain unchanged unless a user manually changes it.

'ope-that-'elps

G LS
 
Like he said :). I would only add that if you want the time as well, to default to Now() instead of Date(). Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top