I am trying to calculate our values from one field called Yr_Install which is a short integer. to a new field called Year_Install which I created and made it a Date data type. When I try to field calculate the values from the short integer field which has the values 1968, 1914, 2014,2012 etc into the new year installed field all it does is populate the field with some random date and 1905 for all values.( i.e 6/8/1905)
what is the vb or python script to move the data over to the new field
Solved! Go to Solution.
Erik,
You will need to include a month and a day to get a consistent date value.
vbScript:
"01/01/" & Yr_install
Regards,
Tom
Erik,
You will need to include a month and a day to get a consistent date value.
vbScript:
"01/01/" & Yr_install
Regards,
Tom
Tom
Thanks for the help. We never kept day and month we were just concerned with the year. Is there anyway around that or do I have to just create a generic day and month for all the features
Erik,
If you don't have a specific month and day for them, you can just set them all to January 1st for that year. When you are display the dates anywhere you can just display the year. It might be best to just keep the field as an integer if you are only concerned with the year.
Regards,
Tom
Tom
Thanks. The only reason i am doing this is cause I want to test out the LGIM and in order to import my data into the models schema I need to make sure that data types match for corresponding fields and the model has their year installed field as date. But maybe I will just make everything janurary like you suggested. Thanks
Erik,
You are welcome!
Regards,
Tom