Juanita
SSCertifiable
Points: 5300
More actions
March 30, 2006 at 2:46 pm
#167790
Hi. I have a table that the developer wants to have the 'year' field loaded automatically with the 4 digit current year. is there a way to do this when setting up the table using the default value option?
Thanks,
lucky-80472
Points: 7793
March 30, 2006 at 2:51 pm
#629979
What is the datatype of the year field? if it is either int / smallint then you can default it like this
default datepart(yy,getdate())
Thanks and have a nice day!!!
Lucky
March 30, 2006 at 3:07 pm
#629983
Thanks !!! that worked perfectly!!!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply