AnsweredAssumed Answered

How to build a whereClause with a datetime field in Python

Question asked by jsn on Mar 2, 2016
Latest reply on Mar 2, 2016 by JTodd-esristaff

Hello everyone,

 

What is the syntax to use a date field in a whereClause?

 

This code does not work:

 

datetimeVal = rowYesterday.getValue("DIGIDATE")
       
whereClause = "DateAGMT = " + datetimeVal                          ==============   This syntax does not work

 

srcToday = arcpy.SearchCursor(AGREEMENT, whereClause)

 

Thank you

Outcomes