I want to automatically add the today's date into a field on my database for DateEntered.
In access I just use the date() function as the default value in the field. Is there a similar function for mysql?
if not i can enter it when the other data is enterered but am unsure of the syntax. when i tried getdate() id didn't work do I need to put anything in the () part or am i completely barking up the wrong tree/
Any help appreciated
[SOLVED] adding a date in
Moderator: General Moderators
-
nutstretch
- Forum Contributor
- Posts: 104
- Joined: Sun Jan 11, 2004 11:46 am
- Location: Leicester
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
-
nutstretch
- Forum Contributor
- Posts: 104
- Joined: Sun Jan 11, 2004 11:46 am
- Location: Leicester
-
rajshekhar
- Forum Newbie
- Posts: 1
- Joined: Fri Jan 16, 2004 5:57 am
- Location: India
- Contact:
Small answer check out http://www.mysql.com/doc/en/DATETIME.html . Long answer, make a column of type TIMESTAMP. The TIMESTAMP column type provides a type that you can use to automatically mark INSERT or UPDATE operations with the current date and time. If you have multiple TIMESTAMP columns, only the first one is updated automatically.