Hello,
Within ArcPro 2.4, I'm trying to calculate a new field from two existing fields. The first field is an ID field of type text, and the second is a full date and time field of type Date. I want to separate the two with an underscore. I use the following in the Field Calculator:
Problem is, my results end up being <Null> for the new column AKEY. The new column AKEY is type text, with 8000 length.
Solved! Go to Solution.
ArcGIS Pro thinks your Python expression is valid, so if you are getting lots of Null, it makes me wonder if you have a selection on the table so you are only calculating for a small subset of records but looking at all the records afterwards.
import datetime
idval = '1'
nw = datetime.datetime.now()
"{}_{}".format(idval, nw)
'1_2019-07-22 17:36:38.897392'
python formatter will convert anything to a string which can be used in concatenation
ArcGIS Pro thinks your Python expression is valid, so if you are getting lots of Null, it makes me wonder if you have a selection on the table so you are only calculating for a small subset of records but looking at all the records afterwards.