StrataFrame Forum

GetDate() default value for datetime fields

http://forum.strataframe.net/Topic4914.aspx

By Chris Crabtree - 12/4/2006

Not sure where the root of this issue lies, but specifying GetDate() as the default value for a datetime field in DDT results in the 1/1/1800 value when deployed against SQL Server.

Not a big deal, but it would be convenient if it worked. Also an improvement would be to simply remove the option if it's not going to work so I quit trying it. Smile

Thanks!

By StrataFrame Team - 12/4/2006

The problem is that new records are specified with default values when the AllowNullValuesOnNewRow property is False (default).  So, to correct the issue, you can set that property to false (just know you're going to have plenty of null values), or set the column back to DBNull.Value in the SetDefaultValues() method within the business object.  Then, when the NULL value is inserted into the DB, the DefaultText is used, which is your fn{GetDate()}.