I have a table with date fields. I need to select two rows where the first row is the date just before an input date and the second row is the date just after the input date.
For example, given an input date of "10/06/2022" and the following date table:
The id is an Integer and date is a Date field. The table is an ArcGIS geodatabase table.
id | date |
---|---|
1 | 02/06/2022 |
2 | 05/06/2022 |
3 | 08/06/2022 |
4 | 11/06/2022 |
5 | 16/06/2022 |
6 | 18/06/2022 |
7 | 20/06/2022 |
I need the SQL to return two rows:
id | date |
---|---|
3 | 08/06/2022 |
4 | 11/06/2022 |