free / sql_exporter

Database agnostic SQL exporter for Prometheus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error when parsing MSSQL date time field

mirrorspock opened this issue · comments

the query

      SELECT Activity, max(Stop) AS LastStopTime
      FROM [ACCP_API].[dbo].[ActivityLog]
      GROUP BY Activity

returns an error
* [from Gatherer #1] [, collector="sixfold_data_freshness", query="sixfold_update_time"] scanning of query result failed: sql: Scan error on column index 1, name "LastStopTime": converting driver.Value type time.Time ("2021-09-13 12:33:03.543 +0000 UTC") to a float64: invalid syntax

the column type is datetime

i am also facing the same..

scanning of query result failed: sql: Scan error on column index 0, name "time": converting driver.Value type time.Time to a float64: invalid syntax.

Same issue. Ended up casting to floats like this... CAST([Stop] AS FLOAT).