MSSQL with Grafana Graph

I m giving one simple mssql query and my columns would be sys name, resultstatus, date.
I m able to get result in table format, but i want to view it in graph format with date in y axis and status as lines or bar graph. Please let me know how can i achieve this . I tried with timeseries as format with graph view but was not successful in achieving the result.

I am using Grafana 6.1.6 version and was not able to see Metric tab in this version as shown in some videos.

Try returning date column with name “time”.

Hi Torkel,
Thanks for the quick reply.
I tried returning date as time . My date column usually returns date and time together like 2019-03-28 10:05:20.000, but i want only date to appear in ‘y’ axis and in ‘x’ axis i want to view how many have passed or failed for particular date ( with of help of count (status) column mentioned in select query.

Please help on the above.

What was the result / effect when you returned the date column as time?

You don’t tell us what the problem was with trying this suggestion, so we
don’t know what went wrong.


Thanks for the response.
By changing date column to time like this $__time([ExecutionDate]) , the query is running but I am not able to see the the result in graph

What does the Query Inspector tell you?

You should be able to see both the actual query being run against MSSQL, plus
any results being returned.


Hi pooh,

SELECT [System_Name]
,CAST([Result_Status] as INTEGER) as value
FROM TSM_Infra_Result;

The above is my query , Query Inspector is not giving any errors. I just want the visualization to appear in graph after selecting the graph visualization.

In x axis the date needs to appear and and the graph should be based on Result_Status .

Ex : for todays date how many passed and how many failed count.

I m using Grafana 6.1.6 version

Shreya R