When I run the query below, I am getting an error. If I increase the end time by 1 second I can get a result, but it gives me 2 days and I only want 1. All my data is consistently daily at midnight, UTC. Any ideas how to get past this?
SELECT
dp.id,
dp.externalId AS `key`,
dp.timestamp,
dp.value
FROM
`_cdf`.`datapoints` dp
WHERE
dp.externalId IN (
'f18ae31cbfe544cb7bca08da91e5245a-SuFMiCo0f7c8eca4ce444208853aedd00ded4fb',
'730619216b764ba77bc708da91e5245a-SuFMiCo6bb90df0efbc461d863faedd00df009b'
)
AND dp.timestamp >= TO_TIMESTAMP('2022-09-01T00:00:00Z')
AND dp.timestamp < TO_TIMESTAMP('2022-09-02T00:00:00Z')
![](https://uploads-eu-west-1.insided.com/cognite-en/attachment/b6998379-7c83-401a-839f-59bccd004c49.png)
Gives me a result, but not what I want:
![](https://uploads-eu-west-1.insided.com/cognite-en/attachment/523ffed3-079e-4259-9eac-90bc8dee6d8a.png)
cc