AnsweredAssumed Answered

Cannot select by attributes with GDB_TO_DATE field

Question asked by MollyKFoley on Nov 18, 2019
Latest reply on Nov 18, 2019 by JB1234510

Has anybody encountered this problem? I have tried using both a datetime object and a string formatted object in the query and neither work in either python or ArcMap. I am trying to select a record by both its GlobalID and a specific time in the GDB_TO_DATE field on a query layer.

 

Query:

coveyObsvRow[0] = '{1309DFFD-04B3-4F13-9962-C1C378F1F228}'
toDate = fromDate.strftime('%Y-%m-%d %H:%M:%S')
query = "GlobalID = '{0}' and GDB_TO_DATE = '{1}'".format(coveyObsvRow[0], toDate)

#query prints as GlobalID = '{1309DFFD-04B3-4F13-9962-C1C378F1F228}' and GDB_TO_DATE = '2019-11-18 13:58:04'

 

If I select by just using the GlobalID, I can return the records, so it's obviously a problem with the TO_DATE field, but I can't figure it out. I can see the record blatanly in the archive table:

 

(1:58:04 is really stored as 13:58:04 in the database and you will see as much in the ArcMap select by attributes dialog)

Outcomes