I need to select records from a QuickCapture app that were created after a certain timestamp which is written to a feature service table each time the script runs - this is done in order to not append duplicates to the target feature class. I am attempting to pass my "tStamp" variable into 'where_clause' where I'm comparing it to CreationDate in SelectLayerByAttribute. Here's what I have at the moment:
QC_selection = arcpy.management.SelectLayerByAttribute(in_layer_or_view=QC_Feature_Layer, selection_type="NEW_SELECTION", where_clause = """'CreationDate' > timestamp '{0}'""".format(tStamp), invert_where_clause="NON_INVERT")
I've tried combinations of single and double quotes, curly braces, and brackets. I've tried storing the sql expression in a variable and passing that. I've tried formatted string literals syntax of f'{tStamp}' - all of which have thrown the error: 'invalid expression'
When I put CreateDate into a python print statement it returns this format: [1662486472000]. For testing I have a string and date type in my timestamp table. I've tried using both in the where clause with no luck.
I've also tried using arcgis.features.query in the Python API with no luck either. The error here is: 'where' parameter is invalid.
I feel like I've tried everything - anyone have an idea? Thanks.