2

I use influxdb 1.7.9-1 with some databases and some measurements. Now i want to select datapoints in a specific time range from a measurement with filters for fields and one filter for a tag. The timerange is from 2022-01-31T00:00:01.129322Z to 2022-01-31T23:59:54.693945Z

SELECT "test_field" FROM "test_measurement" WHERE ("tag_1" = '165' AND "tag_2" = 'State' AND "tag_3" = 'I' AND time >= '2022-01-31T00:00:00.0Z')

This query is giving me all datapoints between 2022-01-31T00:00:01.129322Z and 2022-01-31T23:59:54.693945Z

Now I want all datapoints between 2022-01-31T00:00:00.00Z and 2022-01-31T01:00:00.0Z

I try it like this:

SELECT "test_field" FROM "test_measurement" WHERE ("tag_1" = '165' AND "tag_2" = 'State' AND "tag_3" = 'I' AND time >= '2022-01-31T00:00:00.0Z' AND time <= '2022-01-31T01:00:00.0Z')

But this query doesn't work.

Is anybody out there who can tell me why?

Or is there another way to query a certain period of time from a database?

UPDATE 2022-03-22: I found something interesting.

I connected the InfluxDB with Grafana. At the picture below you can see my data with Timerange 2022-01-31 00:00:00 to 2022-02-22 00:00:00. This query also works at the CLI.

Grafana1

But then i changed the time range for one day in an suddendly i have no data. Timerange 2022-01-31 00:00:00 to 2022-02-22 00:00:00. Grafana gives me no query, but i changed the time range from query before but there a no datapoints in the CLI.

Grafana2

Is there any setting which i can change in Grafana or InfluxDB that i can see my data in a closer timerange?

TaunTaun
  • 21
  • 3
  • 1. Are you sure that there is any data within this period? 2. Check changing a format to: '2022-01-31T00:00:00Z' or '2022-01-31T00:00:00.000000000Z' – Crashtein Mar 14 '22 at 12:23
  • 1. Yes im sure because when i use the query "SELECT "test_field" FROM "test_measurement" WHERE ("tag_1" = '165' AND "tag_2" = 'State' AND "tag_3" = 'I' AND time >= '2022-01-31T00:00:00.0Z')" i can see datapoints with timestamps between 2022-01-31T00:00:00.00Z and 2022-01-31T01:00:00.0Z. 2. it doesnt work either – TaunTaun Mar 14 '22 at 12:28

0 Answers0