I’m trying to graph the count of different entries in the “Homebase_Name” column. It bar graphs correctly if I use NOW() AS “time”, however I can’t limit the date/time range of course.
I tried specifying the column ‘Date’ AS “time” but Grafana returns an error “invalid type for column time, must be of type timestamp or unix timestamp, got: string Date”
If your SQL is select 'Date' with single quotes then you are saying select a literal string containing the word Date not the Date column. Which is why you are seeing the type error - your result is a string (the word Date).
Thanks for the headsup on that! I finally got it working to Bar Graph within a selected range using these queries below.
SELECT
Date_Time AS “time”,
Homebase_Name,COUNT(Homebase_Name)
FROM Homebase View
WHERE Homebase_Name = ‘Off-Base’ AND $__timeFilter(Date_Time)
GROUP BY time
SELECT
Date_Time AS “time”,
Homebase_Name,COUNT(Homebase_Name)
FROM Homebase View
WHERE Homebase_Name = ‘TSRT’ AND $__timeFilter(Date_Time)
GROUP BY time
SELECT
Date_Time AS “time”,
Homebase_Name,COUNT(Homebase_Name)
FROM Homebase View
WHERE Homebase_Name = ‘GRST’ AND $__timeFilter(Date_Time)
GROUP BY time