x3la
July 19, 2024, 3:04pm
1
Grafana: 10.0.2
InfluxDB: 1.8.10-1
OS: Ubuntu
I hope this is the correct place to ask. Apologies if not.
I am trying to query data from InfluxDB in Grafana ‘Explore’ in influxql.
I would like to compare a string field ‘AvailableDate’ against the time stamp of the data itself (time). This field is in MM/DD/YYYY format.
SELECT … WHERE time >= AvailableDate
Is there any way that I can cast this string to a timestamp format for comparison?
why is that column a string? wouldnt it be better that its data type is datetime in the first place?
x3la
July 19, 2024, 3:22pm
3
Ideally yes but that’s unfortunately not something I can change. I have over a year of historical data and this is a field I now need to generate a report with.
1 Like
grant2
July 21, 2024, 10:36am
4
@x3la
Just in case you can change from InfluxQL to Flux, this should be possible using the time()
function in Flux.
x3la
July 21, 2024, 12:24pm
5
I don’t think that will work as the date isn’t in RFC3339 format, it’s mm/dd/yyyy.
I think I’ll just dump the data and import it into something else.