# Mysql: Column metric must be of type CHAR, VARCHAR

**URL:** <https://community.grafana.com/t/mysql-column-metric-must-be-of-type-char-varchar/15959>\
**Category:** MySQL\
**Tags:** mysql\
**Created:** [April 2, 2019, 8:22pm UTC](https://community.grafana.com/t/mysql-column-metric-must-be-of-type-char-varchar/15959 "2019-04-02T20:22:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevink00](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@kevink00](https://community.grafana.com/u/kevink00)\
**Post date:** [April 2, 2019, 8:22pm UTC](https://community.grafana.com/t/mysql-column-metric-must-be-of-type-char-varchar/15959/1 "2019-04-02T20:22:58Z")

</div>

How can I get the correct type to create a pie chart?

I have the following in my database:

```
Value varchar(100)
datetime datetime 

```

In Grafana I get the following errors when trying to CAST or CONVERT ‘Value’

```
SELECT
  datetime AS "time",
  CONVERT(Value, UNSIGNED) AS metric
FROM myTable

```

`SELECT datetime AS "time", CAST(Value AS UNSIGNED) AS metric FROM myTable`

`Column metric must be of type CHAR, VARCHAR, TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT. metric column name: metric type: BIGINT but datatype is *uint64`

---

<div class="post-metadata">

**Author:** ![rich36](https://avatars.discourse-cdn.com/v4/letter/r/58f4c7/32.png) [@rich36](https://community.grafana.com/u/rich36)\
**Post date:** [June 4, 2020, 8:51pm UTC](https://community.grafana.com/t/mysql-column-metric-must-be-of-type-char-varchar/15959/2 "2020-06-04T20:51:18Z")

</div>

I would also love to know the answer to this… Getting same error and my datatype is BIGINT

 ![image](https://us1.discourse-cdn.com/grafana/original/2X/4/45a5d16c691a680ea5e3de39107784396ab1ee18.png)
