Failed to convert time column: column type "[]*string" is not convertible to time.Time

I have database in MS SQL. One of table have column “time” with varchar, now I tried to fetch this in Grafana dashboard table but it’s showing error message “converting time columns failed: failed to convert time column: column type “*string” is not convertible to time.Time”

Can anyone help me? I’m new in Grafana

I have database in MS SQL. One of table have column “time” with varchar,

Why? If it’s a timestamp, why doesn’t it have that data type?

now I tried to fetch this in Grafana dashboard table but it’s showing
error message “converting time columns failed: failed to convert time
column: column type “*string” is not convertible to time.Time”

Show us an example of what is actually stored in that column - what is the
timestamp format?

Antony.

I’m storing the time only minutes in that column. Timestamp format is hh:mm DD/MM/YYYY

That’s a most unusual format for a timestamp, so I’m not surprised it doesn’t
get converted automatically.

I would start by using some string manipulation functions to turn it either
into YYYY/MM/DD hh:mm:00 or YYYY-MM-DD hh:mm:00 and see whether that can then
be accepted as a timestamp.

I’ve never used MS SQL so I can’t suggest what that sort of string
manipulation might look like, but I’m sure that can’t be hard to work out.

Incidentally, if you’re storing timestamps as varchars, what do you do at the
summer/winter time changes? How do you avoid duplicated timestamps when “the
clocks go back” by one hour?

Antony

1 Like

You can’t use that field. You need to add another column with utc timestamp that matches the other column. Since it is a varchar data type column, someone can add Mercedes Benzo as data in it. How is data being populated into this table?

Never mind, I had changed the field to number and now no need to convert it. I just want minutes on this field not date and time.

1 Like