Member Avatar

Hello,
i want to search date greater than particular date but my date column datatype in text,
How could i do,i used following query

SELECT * from $table Where postedDate>='21-August-2013' and postedDate<='22-August-2013' ORDER BY modified_date DESC

this not working properly

Recommended Answers

MySQL has a STR_TO_DATE function, which you can use to convert the string to an actual date.

Jump to Post

All 2 Replies

MySQL has a STR_TO_DATE function, which you can use to convert the string to an actual date.

Member Avatar

Thanks,
I tried but it returns empty result

SELECT * from $table Where str_to_date(postedDate,'%e-%M-%Y')>='21-August-2013' and postedDate<='22-August-2013' 
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.