# to\_timestamp(column,'YYYY-MM-DD HH24:MI:SS') as time gives "Data points outside time range" in the time series graph

**URL:** <https://community.grafana.com/t/to-timestamp-column-yyyy-mm-dd-hh24ss-as-time-gives-data-points-outside-time-range-in-the-time-series-graph/12029>\
**Category:** PostgreSQL\
**Tags:** postgres\
**Created:** [November 15, 2018, 5:53am UTC](https://community.grafana.com/t/to-timestamp-column-yyyy-mm-dd-hh24ss-as-time-gives-data-points-outside-time-range-in-the-time-series-graph/12029 "2018-11-15T05:53:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lovika](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@lovika](https://community.grafana.com/u/lovika)\
**Post date:** [November 15, 2018, 5:53am UTC](https://community.grafana.com/t/to-timestamp-column-yyyy-mm-dd-hh24ss-as-time-gives-data-points-outside-time-range-in-the-time-series-graph/12029/1 "2018-11-15T05:53:07Z")

</div>

I am creating time series graph using postgres data source. I don’t have column in timestamp data type the columns are character varying type. I type casted the column using to\_timestamp() and used the column keeping its alias as time though getting “Data points outside time range” on the graph.

I couldn’t use $\_\_time as it doesn’t support to\_timestamp or CAST() and gives an error.  
Could someone suggest what would be the work around for this problem?

---

<div class="post-metadata">

**Author:** ![lovika](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@lovika](https://community.grafana.com/u/lovika)\
**Post date:** [November 15, 2018, 6:52am UTC](https://community.grafana.com/t/to-timestamp-column-yyyy-mm-dd-hh24ss-as-time-gives-data-points-outside-time-range-in-the-time-series-graph/12029/2 "2018-11-15T06:52:24Z")

</div>

Solved it by adding another time column in where clause
