提问人:Max86 提问时间:9/22/2023 最后编辑:ShadowMax86 更新时间:9/22/2023 访问量:38
Grafana Datediff with Synapse Datasource
Grafana Datediff with Synapse Datasource
问:
我有一个简单的查询,可以使用其内置的 MySql Server 在 Azure Synapse 中工作:
SELECT TOP (15)
cast ("Betriebstag" as DATETIME),
CONVERT (VARCHAR, "Betriebstag", 34) as "betriebstag",
"MWNR",
"kwhUsed" as "Ist-Verbrauch",
"kWh_prediction" as "ML Prognose",
"kwh_prediction_linear_temperature" as "Lineare Prognose",
cast ("prediction_written" as DATETIME)
FROM [dbo].[XYZ]
WHERE ("Betriebstag" BETWEEN '2023-08-01' AND '2023-08-15')
AND "MWNR" = 4021
AND DATEDIFF(day, "Betriebstag", "prediction_written") = -1
AND kwhUsed is not null
ORDER BY "Betriebstag" asc
在 Grafana 中,我使用相同的数据库。但是,使用相同的查询时,我收到错误:
convert frame from rows error: mssql: Conversion failed when converting date and/or time from character string.
在 Grafana 中使用 DATEDIFF 有什么区别吗?或者将我的时间戳变量转换为 DATETIME 是否有问题?
谢谢!
答: 暂无答案
评论