I am writing a script to access data from each day. I would like to select by attribute and send these features to a local file geodatabase. After reading some documenation, CURRENT_DATE is the function which reads data for today.
This is an example of my data '2015-02-02 00:00:00'. I don't have the time for any features, so in reality it is only YYYY-MM-DD. In a local file geodatabase, the query
PlannedDate = CURRENT_DATE works. However in my ArcSDE SQL Server connection it does not.
enter image description here
-
1Date handling is notoriously different by database provider. You can't use a file geodatabase construct on a Microsoft database; you must use a Microsoft equivalent.Vince– Vince2015年02月02日 20:02:48 +00:00Commented Feb 2, 2015 at 20:02
-
Please always include error messages as text rather than pictures. That way they are available to future searches.PolyGeo– PolyGeo ♦2016年06月19日 08:41:05 +00:00Commented Jun 19, 2016 at 8:41
2 Answers 2
This function requires SQL Server Syntax for the mm/dd/yyyy format.
PlannedDate = CONVERT(DATE, GETDATE())
I had the same problem. Simply replace
datetimestart >=CURRENT_DATE -1
with
datetimestart >=GETDATE()-1
Explore related questions
See similar questions with these tags.