Search code examples
databaseinfluxdb

i want data between time 10:AM to 10:PM on per day in influxdb


i want data between time 10:AM to 10:PM on per day in influxdb

if I am used Regular-Expression to ignore date then I getting timestamp error same can anyone help thanks in advance


Solution

  • Use relative time range, group by day.

    If you want only specific times for each day, you will need to calculate the date range client side and specify an explicit date and time range for each daily query.

    Relative range with specific time is not supported.

    Relative for past 7 days:

    SELECT count(volume) from ACC 
    WHERE time > now() - 7d
    GROUP BY time(1d)
    

    Explicit for 10am to 10am for one day:

    SELECT count(volume) from ACC 
    WHERE time >= '2018-01-07T10:00:00'
    AND time < '2018-01-08T10:00:00'
    GROUP BY time(1d)