Enter the following clause in the WHERE:
DATEPART(MINUTE,[CAMPO DATA]) % 10 < 5
Explaining what is being done: I am isolating the last digit of the minute from its datetime field and verifying that it is contained in {0,1,2,3,4}.
With that I believe it will return the expected values.
Example (items in bold will be returned:
-
01/30/2018 08:00
1/30/2018 8:05 AM 30/01/2018 08:11
1/30/2018 08:17
1/30/2018 8:23 AM
1/30/2018 8:28 AM 30/01/2018 08:33
1/30/2018 8:38 PM
The table has only two fields:
datehora (datetime) tag (varchar (30)
Table contents:
datahora tag
2016-04-01 00: 01: 03.580 PDT_1_T13 @ PV
2016-04-01 00: 06: 03.580 PDT_1_T13 @ PV
2016-04-01 00: 11: 03.580 PDT_1_T13 @ PV
2016-04-01 00: 16: 03.580 PDT_1_T13 @ PV
2016-04-01 00: 21: 03.580 PDT_1_T13 @ PV
If the selection is 01-04-2016 00:00:00 until 01-04-2016 00:35:00
10-minute interval. Home
Expected Exit
datahora tag
2016-04-01 00: 01: 03.580 PDT_1_T13 @ PV
2016-04-01 00: 11: 03.580 PDT_1_T13 @ PV
2016-04-01 00: 21: 03.580 PDT_1_T13 @ PV