Question: I need to find max date from a table(mysql database). I am storing my date as varchar.

`select max(completion_date) from table_name` returns wrong value.

<http://sqlfiddle.com/#!9/c88f6/3>

Answer: 
Assuming the date time format you have in your fiddle (e.g. '12/19/2012 05:30 PM') then:

```
select max(STR_TO_DATE(completion_date, '%m/%d/%Y %l:%i %p')) from test;

```

<http://sqlfiddle.com/#!9/c88f6/15>

It's unclear if you want to factor the time into your rankings or just the date. This example accounts for time too, but you can remove that part of the formatter if desired.
I am not sure why you would want to keep it as varchar not date.
But this will work for varchar:

```
SELECT completion_date
FROM test
ORDER BY STR_TO_DATE(completion_date, '%m/%d/%Y') DESC LIMIT 1;

```

<http://sqlfiddle.com/#!9/c88f6/10>