Non date-formatted date column

Hi, I have a date column that is just an integral value, i.e. 1, 2, 3, 4, 5 etc. How can I use this column as a date column in a graph panel?

My SQL looks like this:

select date_index as "date", value from my_table, order by date_index;

It currently just plots one value (the last one I think) and then says “data points outside time range”.