Member Avatar for angiesavio

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

All 2 Replies

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

Member Avatar for angiesavio

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.