PDA

View Full Version : English Like Date Stored in MySQL



binarytrends
30 Oct 2005, 05:06 AM
Hi Guys,
Long ago by mistake I made one of my Date fields type VARCHAR in MySQL table and later on when there were thousands of record in the table I needed to compare those dates to the current date. However I got round it finally but after a real big struggle. I thought I would share it with you. Here is how you can do it :

DATEDIFF(str_to_date(right(myDateField, 22),'%d %b %Y'),CURDATE())>0

:)

http://www.binarytrends.com