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

How to set a default value for a date field to now?

Status
Not open for further replies.

TheBugSlayer

Programmer
Sep 22, 2002
887
US
Hi all. I have created a table and I would like the date field to have a default value of GetDate() on creation of the record. Howo do I achieve that?

I was exploring creating a function and used it with a 'computed' column but that will not assign a default value to the field.

Your help is appreciated.
 
In Enterprise Manager, open the table in Design View and select the column you want to set the date for. Then, in the options at the bottom of the screen, just enter GetDate() for the default value.

Hope this helps.
 
Thanks, I tried it that way but I had a syntx error. It works, thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top