GetDate() default value for datetime fields


Author
Message
Chris Crabtree
Chris Crabtree
StrataFrame Novice (57 reputation)StrataFrame Novice (57 reputation)StrataFrame Novice (57 reputation)StrataFrame Novice (57 reputation)StrataFrame Novice (57 reputation)StrataFrame Novice (57 reputation)StrataFrame Novice (57 reputation)StrataFrame Novice (57 reputation)StrataFrame Novice (57 reputation)
Group: Forum Members
Posts: 57, Visits: 107
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!

StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
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()}.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search