0

retrieve next 24 hours details from the table

i read one thread, same question here

link text

but small diff is , my field name is jdate is the varachar, but they are used the datetime data type format,

Community
  • 1
  • 1
Bharanikumar
  • 25,457
  • 50
  • 131
  • 201

1 Answers1

1

use str_to_date before :)

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_str-to-date

so the sql like :

WHERE STR_TO_DATE(my_field,'myformat') > DATE_SUB( NOW(), INTERVAL 24 HOUR)
Haim Evgi
  • 123,187
  • 45
  • 217
  • 223