mike55 Posted May 27, 2005 Posted May 27, 2005 Hi When creating a table, you have the option of assigning a default value for a column. Is it possible to set the default value for a datatime column to the current date and time? Mike55. Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
stustarz Posted May 27, 2005 Posted May 27, 2005 Are you using SQL Server? If so the default value for the current date is : GetDate() Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
mike55 Posted May 27, 2005 Author Posted May 27, 2005 Sorry, should have provided more information: Database is SQL server 2000. Am trying to set the default value in the table design page of enterprise manager. Yea GetDate() works, thanks. Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
mike55 Posted May 27, 2005 Author Posted May 27, 2005 Is there a list of all the functions that I can put into the default value field available? Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
stustarz Posted May 27, 2005 Posted May 27, 2005 Just had a quick look through Sql Server BOL and cant seem to find anything listing functions that can be used in the default value column. And, i have only ever set INT, VARCHAR and DATETIME defaults - of which DATETIME was the only one that required a function call to set the current date and time! Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
mike55 Posted May 27, 2005 Author Posted May 27, 2005 Yea, thats were I started searching originally, but came up with nothing of value, if I come across anything interesting, I'll let you know. Mike55. Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.