<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculate field question in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculate-field-question/m-p/51035#M4050</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;dateTimeExp = "str(!AccDate!) + ' ' + str(!AccTime!)"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 May 2012 20:54:06 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2012-05-03T20:54:06Z</dc:date>
    <item>
      <title>Calculate field question</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-question/m-p/51034#M4049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Any idea why the following code will not work? If I take out the " " and one +, it will run, but not the result I need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#dateTimeExp = "!AccDate! + " " + !AccTime!" dateTimeExp = "str(!AccDate! + " " + !AccTime!)" arcpy.CalculateField_management(outCrash, "AccDT", dateTimeExp, "PYTHON")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It returns the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: ERROR 000539: Error running expression: str("4/1/2005" +&amp;nbsp; + "7:35:00 AM") &amp;lt;type 'exceptions.TypeError'&amp;gt;: bad operand type for unary +: 'str'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalculateField).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 20:44:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-question/m-p/51034#M4049</guid>
      <dc:creator>MichaelMiller2</dc:creator>
      <dc:date>2012-05-03T20:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field question</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-question/m-p/51035#M4050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;dateTimeExp = "str(!AccDate!) + ' ' + str(!AccTime!)"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 20:54:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-question/m-p/51035#M4050</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-05-03T20:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field question</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-question/m-p/51036#M4051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Doh, Mathew beat me, but this also works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;exp = 'str(!AccDate!) + " " + str(!AccTime!)'&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 21:05:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-question/m-p/51036#M4051</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-05-03T21:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field question</title>
      <link>https://community.esri.com/t5/python-questions/calculate-field-question/m-p/51037#M4052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you gentlemen!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm just getting up to speed with Python and this list is great for nudging me over the hurdles.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Michael Miller&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 12:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-field-question/m-p/51037#M4052</guid>
      <dc:creator>MichaelMiller2</dc:creator>
      <dc:date>2012-05-04T12:27:47Z</dc:date>
    </item>
  </channel>
</rss>

