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

GETDATE()

Status
Not open for further replies.

dmaier

MIS
Apr 13, 2002
38
US
I just tried to use the GETDATE()function in design view for a table column. It is a smalldatetime data type and the length is supposed to be 4. Every time I save the record it saves as this (getdate()) and it doesn't work when adding a record.

Does anyone know what the problem might be?
 
Are you using the GetDate() function in the default setting area?

Thanks

J. Kusch
 
No it is in the Table Design view in Default Value.
 
That is what I meant. Hmmm interesting! You are not supply a value for that field when you are inserting ... are you?

Thanks

J. Kusch
 
The Default Value for a column must be a constant expression. You could maintain it with an insert trigger but whatever process is inserting a record would be the place to put code to insert the current date IMHO.

JHall
 
jhall - I just tested (getdate()) as a default in EM for a datetime field with no problems.
 
My bust, you're right. I just had it work for me too. My apologies.

JHall
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top