Select to view content in your preferred language

Remove Timestamp in Date Field used in Filter

406
0
10-30-2023 07:58 AM
Chip727
New Contributor II

We need to count how many sample points were captured within a sampled area. To do this, I've setup an Arcade script that evaluates the selected sample area against the intersecting sample point feature class. However, I need to filter the intersecting sample points by the sample_date field since an area may be sampled multiple times (on different dates). I tried to filter the sample points by the selected sample area's date, but I continue to get a '0' because of the timestamp included in both fields. I was able to remove the timestamp on the sample area sample_date field (var smpldt below). However, I'm not sure how to remove the timestamp from the sample points "sample_date" field in the SQL statement. Is there a way to do this so that the number of sample points for a specific date populate?

var buff_areas = Buffer($feature, 50, "feet");

var intersecting_points = Intersects(FeatureSetByName($datastore, "Sample_Points_FC_Name"), buff_areas);
var smpldt = Text($feature.sample_date, 'Y-MM-DD');

var filtersmpldt = Filter(intersecting_points, "sample_date = '" + smpldt + "'");
var cnt = Count(filtersmpldt);

return cnt

Tags (2)
0 Kudos
0 Replies