Summary
Select features based on date and time ranges (for example, Last 14 days) or parts (weekdays, 8-10PM). Requires date and time values to be in date field. When multiple options are selected from Select By Date, Select By Time, Select By Day of Week, and Select By Month the selection set will only contain features that satisfy all of the selection criteria.
Usage
- The input must be a feature layer.
- This tool requires an input date field. If your input features do not contain a date field, the Convert Time Field tool can be used to generate a date field derived from dates formatted as text in a text field.
- This tool performs a selection using all of the selection criteria in the Select by Date, Select by Time, Select by Day of Week, and Select by Month sections. If any part of the input date does not match the selection criteria, the feature will not be selected. This behavior is similar to an AND operator in an SQL query statement.
- When Use Time Range is enabled and either the input value in the Start Date Field or End Date Field is null, the record will be treated as a single time stamp event, rather than an event that occurred over a time range.
Syntax
SelectByDateTime_crime (Input_Features, Selection_type, Use_Time_Range, {Date_Field}, {Start_Date_Field}, {End_Date_Field}, {Select_by_Date}, {Date_Selection_Type}, {Start_Date}, {End_Date}, {Single_Date}, {Use Current System Time as End Time}, {Time_Slice_Unit}, {Select_by_Time_of_Day}, {Start_Time}, {End_Time}, {Select_by_Day_of_Week}, {Day_of_Week_Selection_Type}, {Monday}, {Tuesday}, {Wednesday}, {Thursday}, {Friday}, {Saturday}, {Sunday}, {Select_by_Month}, {January}, {February}, {March}, {April}, {May}, {June}, {July}, {August}, {September}, {October}, {November}, {December}, {Select_by_Year}, {Years})
Parameter | Explanation | Data Type |
Input Features | Input features containing date field to base selection. | Feature Layer |
Selection type |
Determines how the selection will be applied and what to do if a selection already exists.
|
String |
Use Time Range | Select option if input features contain attributes describing both a start date/time and end date/time for an incident. | Boolean |
Date Field (Optional) | Date field from input layer to base selection. | Field |
Start Date Field (Optional) | Start date field from time range to base selection. This parameter is ignored if the Use Time Range parameter is not checked. | Field |
End Date Field (Optional) | End date field from time range to base selection. This parameter is ignored if the Use Time Range parameter is not checked. | Field |
Select by Date (Optional) | Select this option to select features based on a date range or recency period. | Boolean |
Date Selection Type (Optional) |
|
String |
Start Date (Optional) | Start date of date range. This parameter is ignored if By Date Range Date selection type is not used. | Date |
End Date (Optional) | End date of date range. This parameter is ignored if By Date Range Date selection type is not used. | Date |
Single Date (Optional) | Single date in past to be queried. This parameter is ignored if By Single Date date selection type is not used. | Date |
Use Current System Time as End Time (Optional) | Select this option to include events from the current day (if existing) in the recent time period. This option generally makes more sense for actively updated input features. Example: If the time period length specified was 14 days and the system time when running the tool was 5pm on January 15th, the recency time period would include all events between 5pm on the date 14 days ago and 5pm today (January 1, 2017 5:00:00 PM to January 15, 2017 5:00:00 PM). If left unchecked the recent period uses the beginning of the current day as the end time. Using the example above of a 14 day time period this would cover the range January 1, 2017 12:00:00 AM to January 15, 12:00:00 AM. This parameter is ignored if By Recency or By Comparative Time Period Date Selection Type is not used. | Boolean |
Time Slice Unit (Optional) | Number of time units defining the recent time period to base selection (for example, events in the last 14 days). This parameter is ignored if By Recency or By Comparative Time Period Date Selection Type is not used. | Time Unit |
Select by Time of Day (Optional) | Use this option to select features occurring within a time range. Example: For evenings specify 5:00:00 PM to 8:00:00 PM. | Boolean |
Start Time (Optional) | Start time of time range. | Date |
End Time (Optional) | End time of time range. | Date |
Select by Day of Week (Optional) | Use this option to select features by day of the week. | Boolean |
Day of Week Selection Type (Optional) | Weekend Only: Saturday or Sunday Weekdays Only: Monday through Friday Specify Days |
String |
Monday (Optional) | Select features occurring on Monday. | Boolean |
Tuesday (Optional) | Select features occurring on Tuesday. | Boolean |
Wednesday (Optional) | Select features occurring on Wednesday. | Boolean |
Thursday (Optional) | Select features occurring on Thursday. | Boolean |
Friday (Optional) | Select features occurring on Friday. | Boolean |
Saturday (Optional) | Select features occurring on Saturday. | Boolean |
Sunday (Optional) | Select features occurring on Sunday. | Boolean |
Select by Month (Optional) | Use this option to select features by month. | Boolean |
January (Optional) | Select features occurring in January. | Boolean |
February (Optional) | Select features occurring in February. | Boolean |
March (Optional) | Select features occurring in March. | Boolean |
April (Optional) | Select features occurring in April. | Boolean |
May (Optional) | Select features occurring in May. | Boolean |
June (Optional) | Select features occurring in June. | Boolean |
July (Optional) | Select features occurring in July. | Boolean |
August (Optional) | Select features occurring in August. | Boolean |
September (Optional) | Select features occurring in September. | Boolean |
October (Optional) | Select features occurring in October. | Boolean |
November (Optional) | Select features occurring in November. | Boolean |
December (Optional) | Select features occurring in December. | Boolean |
Select by Year (Optional) | Use this option to select features occurring in specified year. | Boolean |
Year(s) (Optional) | Choose years containing features to be selected. | Long |
Licensing information
- ArcGIS Desktop Basic: Yes
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes