I want to update an attribute if the date from another attribute is tomorrows date. My script runs without error but nothing gets updated. I think the If statement needs to be adjusted. Any help?
<SPAN class="keyword token">with</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>da<SPAN class="punctuation token">.</SPAN>UpdateCursor<SPAN class="punctuation token">(</SPAN>layer<SPAN class="punctuation token">,</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="string token">'StartDate'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'Status'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> row <SPAN class="keyword token">in</SPAN> cursor<SPAN class="punctuation token">:</SPAN>
today <SPAN class="operator token">=</SPAN> datetime<SPAN class="punctuation token">.</SPAN>datetime<SPAN class="punctuation token">.</SPAN>today<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
tomorrow <SPAN class="operator token">=</SPAN> today <SPAN class="operator token">+</SPAN> datetime<SPAN class="punctuation token">.</SPAN>timedelta<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
tmw <SPAN class="operator token">=</SPAN> datetime<SPAN class="punctuation token">.</SPAN>datetime<SPAN class="punctuation token">.</SPAN>strftime<SPAN class="punctuation token">(</SPAN>tomorrow<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'%Y-%m-%d 00:00:00'</SPAN><SPAN class="punctuation token">)</SPAN>
tmw2 <SPAN class="operator token">=</SPAN> datetime<SPAN class="punctuation token">.</SPAN>datetime<SPAN class="punctuation token">.</SPAN>strftime<SPAN class="punctuation token">(</SPAN>tomorrow<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'%Y-%m-%d 23:59:59'</SPAN><SPAN class="punctuation token">)</SPAN>
com <SPAN class="operator token">=</SPAN> <SPAN class="string token">"BETWEEN timestamp '"</SPAN> <SPAN class="operator token">+</SPAN> tmw <SPAN class="operator token">+</SPAN> <SPAN class="string token">"' AND timestamp '"</SPAN> <SPAN class="operator token">+</SPAN> tmw2 <SPAN class="operator token">+</SPAN><SPAN class="string token">"'"</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>str<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">==</SPAN> com<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Match Found!"</SPAN><SPAN class="punctuation token">)</SPAN>
row<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="string token">'Active'</SPAN>
cursor<SPAN class="punctuation token">.</SPAN>updateRow<SPAN class="punctuation token">(</SPAN>row<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">'Complete'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>