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”
Below is the table and the queries I used.
+---------------+--------+----------+---------------------+
| Homebase_Name | SOP_id | Homebase | Date |
+---------------+--------+----------+---------------------+
| Off-Base | 1 | 3 | 2020-01-04 00:00:00 |
| Off-Base | 20 | 3 | 2020-06-10 00:00:00 |
| TSRT | 21 | 1 | 2020-06-12 00:00:00 |
| TSRT | 22 | 1 | 2020-06-12 00:00:00 |
| GRST | 34 | 2 | 2021-02-10 00:00:00 |
+---------------+--------+----------+---------------------+
SELECT
‘Date’ AS “time”,
Homebase_Name,COUNT(Homebase_Name)
FROM Homebase View
WHERE Homebase_Name = ‘Off-Base’
SELECT
‘Date’ AS “time”,
Homebase_Name,COUNT(Homebase_Name)
FROM Homebase View
WHERE Homebase_Name = ‘TSRT’
SELECT
‘Date’ AS “time”,
Homebase_Name,COUNT(Homebase_Name)
FROM Homebase View
WHERE Homebase_Name = ‘GRST’