Is there a way to select points from a range of dates to create a new layer? I want to clean up my data by making all points from previous years a separate layer but doing a selection by attributes and choosing each date individually is taking way too long.It would be perfect if there was a way to query out all points from 2013, for example.
-
1Do you have a field that is populated with a date?– a1234Commented Mar 30, 2015 at 18:14
-
What software are you using? From your terminology I'm guessing ArcGIS, but methods and tools may differ from software to software. What format/data type is your date field (string, actual date field)? For that matter what format is your data (shapefile, feature class in geodatabase)?– Chris WCommented Mar 30, 2015 at 18:18
-
I am using ArcMap 10.1 and the data I'm referring to is a layer from a feature class in a geodatabase. The data already has a date collected field. I could in theory select by attribut and select dates individually but I have thousands of points to go through.– ZevCommented Mar 30, 2015 at 18:26
-
@Zev Have you tried to use the Select by Attribute tool, to select records that don't equal (<>) 2013? Once this selection is done, you can export the selected data, or use it as needed. resources.arcgis.com/en/help/main/10.1/index.html#//…– a1234Commented Mar 30, 2015 at 18:32
-
The points I have came from field collections on ArcPad, so the date field is listed as (for example): date'2013-07-03 13:32.19' so I haven't been able figure out a syntax for selecting based on just the year. Thanks so much for your suggestions.– ZevCommented Mar 30, 2015 at 18:48
|
Show 1 more comment
1 Answer
You can use greater-than and less-than operators on dates, so something like this:
"CHANGE_DATE" > date '2012-12-31 00:00:00' AND "CHANGE_DATE" < date '2014-01-01 00:00:00'
Would work to grab all the dates for the year 2013. Note that the specific syntax of the query can change slightly depending on the data source. The above is for a file geodatabase.